From 25f0b4fabce8b3d54041f34c3e4c233705d15879 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Thu, 26 Mar 2009 21:02:38 +0100 Subject: [PATCH] pass to iconv "utf-8" as name of utf8 encoding instead of "utf8" it seems win32 libiconv doesn't support utf8. --- src/charset.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/charset.cpp b/src/charset.cpp index e8e9d1f9..b919c626 100644 --- a/src/charset.cpp +++ b/src/charset.cpp @@ -92,7 +92,7 @@ void utf_to_locale(std::string &s) if (s.empty() || Config.system_encoding.empty() || !has_non_ascii_chars(s)) return; char *tmp = str_pool_get(s.c_str()); - charset_convert("utf8", Config.system_encoding.c_str(), tmp, s.length()); + charset_convert("utf-8", Config.system_encoding.c_str(), tmp, s.length()); s = tmp; str_pool_put(tmp); } @@ -109,7 +109,7 @@ void locale_to_utf(std::string &s) if (s.empty() || Config.system_encoding.empty() || !has_non_ascii_chars(s)) return; char *tmp = str_pool_get(s.c_str()); - charset_convert(Config.system_encoding.c_str(), "utf8", tmp, s.length()); + charset_convert(Config.system_encoding.c_str(), "utf-8", tmp, s.length()); s = tmp; str_pool_put(tmp); } @@ -125,14 +125,14 @@ void str_pool_utf_to_locale(char *&s) { if (!s || Config.system_encoding.empty() || !has_non_ascii_chars(s)) return; - charset_convert("utf8", Config.system_encoding.c_str(), s); + charset_convert("utf-8", Config.system_encoding.c_str(), s); } void str_pool_locale_to_utf(char *&s) { if (!s || Config.system_encoding.empty() || !has_non_ascii_chars(s)) return; - charset_convert(Config.system_encoding.c_str(), "utf8", s); + charset_convert(Config.system_encoding.c_str(), "utf-8", s); } #endif // HAVE_ICONV_H