diff --git a/NEWS b/NEWS index 3459777c4..fc565d5e4 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.18 (2012/??/??) * configuration: - allow tilde paths for socket + - default filesystem charset is UTF-8 instead of ISO-8859-1 * protocol: - new command "toggleoutput" - search for album artist falls back to the artist tag diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx index b75001043..3e324f470 100644 --- a/src/fs/Charset.cxx +++ b/src/fs/Charset.cxx @@ -81,6 +81,9 @@ PathToUTF8(const char *path_fs) { assert(path_fs != nullptr); + if (fs_charset.empty()) + return std::string(path_fs); + GIConv conv = g_iconv_open("utf-8", fs_charset.c_str()); if (conv == reinterpret_cast(-1)) return std::string(); @@ -108,6 +111,9 @@ PathFromUTF8(const char *path_utf8) { assert(path_utf8 != nullptr); + if (fs_charset.empty()) + return g_strdup(path_utf8); + return g_convert(path_utf8, -1, fs_charset.c_str(), "utf-8", nullptr, nullptr, nullptr); diff --git a/src/fs/Config.cxx b/src/fs/Config.cxx index e08e9f0bf..3d7e99b4a 100644 --- a/src/fs/Config.cxx +++ b/src/fs/Config.cxx @@ -60,11 +60,6 @@ ConfigureFS() #endif } - if (charset) { + if (charset != nullptr) SetFSCharset(charset); - } else { - LogDebug(path_domain, - "setting filesystem charset to ISO-8859-1"); - SetFSCharset("ISO-8859-1"); - } }