fs/Traits: enable _UNICODE on Windows

Use wchar_t for everything on Windows.  Solves a lot of filesystem
charset problems.
This commit is contained in:
Max Kellermann
2015-02-25 16:01:46 +01:00
parent 1da0956331
commit 65ff72cdf8
8 changed files with 114 additions and 5 deletions

View File

@@ -268,7 +268,17 @@ LoadPlaylistFile(const char *utf8path, Error &error)
if (*s == 0 || *s == PLAYLIST_COMMENT)
continue;
#ifdef _UNICODE
wchar_t buffer[MAX_PATH];
auto result = MultiByteToWideChar(CP_ACP, 0, s, -1,
buffer, ARRAY_SIZE(buffer));
if (result <= 0)
continue;
const Path path = Path::FromFS(buffer);
#else
const Path path = Path::FromFS(s);
#endif
std::string uri_utf8;