mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-13 20:37:30 +01:00
use Unicode file open API on Windows
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include "Poco/TextConverter.h"
|
#include "Poco/TextConverter.h"
|
||||||
#include "Poco/UTF8Encoding.h"
|
#include "Poco/UTF8Encoding.h"
|
||||||
#include "Poco/UTF16Encoding.h"
|
#include "Poco/UTF16Encoding.h"
|
||||||
|
#include "Poco/UnicodeConverter.h"
|
||||||
#include "Poco/FileStream.h"
|
#include "Poco/FileStream.h"
|
||||||
#include "Poco/File.h"
|
#include "Poco/File.h"
|
||||||
#include "Poco/Path.h"
|
#include "Poco/Path.h"
|
||||||
@@ -156,11 +157,20 @@ protected:
|
|||||||
{
|
{
|
||||||
checkFile();
|
checkFile();
|
||||||
|
|
||||||
|
#if defined(_WIN32) && defined(POCO_WIN32_UTF8)
|
||||||
|
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)
|
if (InFile_Open(&_archiveStream.file, _path.c_str()) != SZ_OK)
|
||||||
{
|
{
|
||||||
throw Poco::OpenFileException(_path);
|
throw Poco::OpenFileException(_path);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
_lookStream.realStream = &_archiveStream.s;
|
_lookStream.realStream = &_archiveStream.s;
|
||||||
LookToRead_Init(&_lookStream);
|
LookToRead_Init(&_lookStream);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user