mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 22:31:23 +01:00
use Unicode file open API on Windows
This commit is contained in:
parent
c0e1b8764e
commit
253cdbc90f
@ -20,6 +20,7 @@
|
||||
#include "Poco/TextConverter.h"
|
||||
#include "Poco/UTF8Encoding.h"
|
||||
#include "Poco/UTF16Encoding.h"
|
||||
#include "Poco/UnicodeConverter.h"
|
||||
#include "Poco/FileStream.h"
|
||||
#include "Poco/File.h"
|
||||
#include "Poco/Path.h"
|
||||
@ -156,11 +157,20 @@ protected:
|
||||
{
|
||||
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)
|
||||
{
|
||||
throw Poco::OpenFileException(_path);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
_lookStream.realStream = &_archiveStream.s;
|
||||
LookToRead_Init(&_lookStream);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user