remove POCO_WIN32_UTF8

This commit is contained in:
Günter Obiltschnig 2020-01-10 15:55:30 +01:00
parent c7c6871c4a
commit 7872c35324
5 changed files with 99 additions and 118 deletions

View File

@ -33,7 +33,7 @@
#include <sqlucode.h>
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
#if defined(POCO_OS_FAMILY_WINDOWS)
#define POCO_ODBC_UNICODE
#define POCO_ODBC_UNICODE_WINDOWS
#elif defined(POCO_OS_FAMILY_UNIX) && defined(UNICODE)

View File

@ -29,11 +29,7 @@ FileStreamTest::~FileStreamTest()
void FileStreamTest::testRead()
{
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
char tmp[]={'\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
std::string file(tmp);
file.append(".txt");
#elif defined(POCO_OS_FAMILY_WINDOWS)
#if defined(POCO_OS_FAMILY_WINDOWS)
char tmp[]={'\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
std::string file(tmp);
file.append(".txt");
@ -57,11 +53,7 @@ void FileStreamTest::testRead()
void FileStreamTest::testWrite()
{
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
char tmp[]={'\xdf', '\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
std::string file(tmp);
file = "dummy_" + file + (".txt");
#elif defined(POCO_OS_FAMILY_WINDOWS)
#if defined(POCO_OS_FAMILY_WINDOWS)
char tmp[]={'\xc3', '\x9f', '\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
std::string file(tmp);
file = "dummy_" + file + ".txt";
@ -86,15 +78,9 @@ void FileStreamTest::testWrite()
void FileStreamTest::testReadWrite()
{
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
char tmp[]={'\xdf', '\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
std::string file(tmp);
file = "dummy_" + file + (".txt");
#else
char tmp[]={'\xc3', '\x9f', '\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
std::string file(tmp);
file = "dummy_" + file + ".txt";
#endif
Poco::TemporaryFile::registerForDeletion(file);

View File

@ -584,7 +584,7 @@ void FileTest::testRenameFailIfExists() {
void FileTest::testLongPath()
{
#if defined(_WIN32) && defined(POCO_WIN32_UTF8) && !defined(_WIN32_WCE)
#if defined(_WIN32) && !defined(_WIN32_WCE)
Poco::Path p("longpathtest");
p.makeAbsolute();
std::string longpath(p.toString());

View File

@ -17,16 +17,16 @@
#include "Poco/Environment.h"
#include <iostream>
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
#if defined(POCO_OS_FAMILY_WINDOWS)
#if defined(_WIN32_WCE)
#include "Poco/Path_WINCE.h"
#else
#include "Poco/Path_WIN32U.h"
#endif
#elif defined(POCO_OS_FAMILY_WINDOWS)
#include "Poco/Path_WIN32.h"
#endif
using Poco::Path;
using Poco::PathSyntaxException;
using Poco::Environment;

View File

@ -162,18 +162,13 @@ protected:
{
checkFile();
#if defined(_WIN32) && defined(POCO_WIN32_UTF8)
#if defined(_WIN32)
std::wstring wpath;
Poco::UnicodeConverter::toUTF16(_path, wpath);
if (InFile_OpenW(&_archiveStream.file, wpath.c_str()) != SZ_OK)
{
throw Poco::OpenFileException(_path);
}
#else
if (InFile_Open(&_archiveStream.file, _path.c_str()) != SZ_OK)
{
throw Poco::OpenFileException(_path);
}
#endif
_lookStream.realStream = &_archiveStream.s;