summaryrefslogtreecommitdiff
path: root/src/PlaylistFile.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-10-18 10:21:39 +0200
committerMax Kellermann <max@musicpd.org>2017-10-18 10:21:39 +0200
commitb4b468eb277f14d75ad5bf49df052e7d873156d9 (patch)
treedd6c5bb238330e18ca45f837c812e4ef05ff6bfc /src/PlaylistFile.cxx
parentbd50a0d2ef5662e8f4164d4f6d1bd763c08ff769 (diff)
parenta7fdfa08e138e5b18f84a9ad52489c6c61861d60 (diff)
Merge tag 'v0.20.11'
release v0.20.11
Diffstat (limited to 'src/PlaylistFile.cxx')
-rw-r--r--src/PlaylistFile.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index d9846044e..a748efb07 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -207,13 +207,12 @@ try {
continue;
#ifdef _UNICODE
- wchar_t buffer[MAX_PATH];
- auto result = MultiByteToWideChar(CP_ACP, 0, s, -1,
- buffer, ARRAY_SIZE(buffer));
- if (result <= 0)
+ /* on Windows, playlists always contain UTF-8, because
+ its "narrow" charset (i.e. CP_ACP) is incapable of
+ storing all Unicode paths */
+ const auto path = AllocatedPath::FromUTF8(s);
+ if (path.IsNull())
continue;
-
- const Path path = Path::FromFS(buffer);
#else
const Path path = Path::FromFS(s);
#endif