aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/Charset.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/Charset.cxx')
-rw-r--r--src/fs/Charset.cxx6
1 files changed, 6 insertions, 0 deletions
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<GIConv>(-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);