aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-06-22 22:20:10 +0200
committerMax Kellermann <max@duempel.org>2015-06-22 22:20:10 +0200
commit73bd6af0f9f1ce9c535ff0a4227e29df3631eb45 (patch)
tree43f864c635b5fa76679e027103e524c75d474b82 /src
parent2aa54c53653abda99c72bfb007c3442a1c3c6d60 (diff)
downloadmpd-73bd6af0f9f1ce9c535ff0a4227e29df3631eb45.tar.gz
mpd-73bd6af0f9f1ce9c535ff0a4227e29df3631eb45.tar.xz
mpd-73bd6af0f9f1ce9c535ff0a4227e29df3631eb45.zip
fs/Charset: hard-code Windows to ACP
Don't define HAVE_FS_CHARSET, and make GetFSCharset() return "ACP" instead of "UTF-8". Ignore the configuration setting, which had no effect anyway.
Diffstat (limited to 'src')
-rw-r--r--src/fs/Charset.cxx2
-rw-r--r--src/fs/Charset.hxx2
-rw-r--r--src/fs/Config.cxx16
3 files changed, 5 insertions, 15 deletions
diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx
index b25615d42..186670ff8 100644
--- a/src/fs/Charset.cxx
+++ b/src/fs/Charset.cxx
@@ -71,6 +71,8 @@ GetFSCharset()
{
#ifdef HAVE_FS_CHARSET
return fs_charset.empty() ? "UTF-8" : fs_charset.c_str();
+#elif defined(WIN32)
+ return "ACP";
#else
return "UTF-8";
#endif
diff --git a/src/fs/Charset.hxx b/src/fs/Charset.hxx
index 49ad07820..9d119fea7 100644
--- a/src/fs/Charset.hxx
+++ b/src/fs/Charset.hxx
@@ -24,7 +24,7 @@
#include "Compiler.h"
#include "Traits.hxx"
-#if defined(HAVE_ICU) || defined(HAVE_GLIB)
+#if (defined(HAVE_ICU) || defined(HAVE_GLIB)) && !defined(WIN32)
#define HAVE_FS_CHARSET
#endif
diff --git a/src/fs/Config.cxx b/src/fs/Config.cxx
index 623736c54..dd809d8b0 100644
--- a/src/fs/Config.cxx
+++ b/src/fs/Config.cxx
@@ -22,10 +22,7 @@
#include "Charset.hxx"
#include "config/ConfigGlobal.hxx"
-#ifdef WIN32
-#include <windows.h> // for GetACP()
-#include <stdio.h> // for sprintf()
-#elif defined(HAVE_GLIB)
+#ifdef HAVE_GLIB
#include <glib.h>
#endif
@@ -37,16 +34,7 @@ ConfigureFS(Error &error)
charset = config_get_string(ConfigOption::FS_CHARSET, nullptr);
if (charset == nullptr) {
-#ifdef WIN32
- /* Glib claims that file system encoding is always utf-8
- * on native Win32 (i.e. not Cygwin).
- * However this is true only if <gstdio.h> helpers are used.
- * MPD uses regular <stdio.h> functions.
- * Those functions use encoding determined by GetACP(). */
- static char win_charset[13];
- sprintf(win_charset, "cp%u", GetACP());
- charset = win_charset;
-#elif defined(HAVE_GLIB)
+#ifdef HAVE_GLIB
const gchar **encodings;
g_get_filename_charsets(&encodings);