Code

charset: pass -1 instead of strlen()
authorMax Kellermann <max@duempel.org>
Fri, 3 Oct 2008 09:52:13 +0000 (11:52 +0200)
committerMax Kellermann <max@duempel.org>
Fri, 3 Oct 2008 09:52:13 +0000 (11:52 +0200)
The GTK charset functions accept "-1" if the parameter is null
terminated.

src/charset.c

index 095817d1502a5b2ed761cc7e036d22fc0f63502c..ccfac0ef86a454c339c2b7479c4eb801e1648fbf 100644 (file)
@@ -71,7 +71,7 @@ utf8_to_locale(const char *utf8str)
        if (noconvert)
                return g_strdup(utf8str);
 
-       str = g_convert_with_fallback(utf8str, strlen(utf8str),
+       str = g_convert_with_fallback(utf8str, -1,
                                      charset, "utf-8",
                                      NULL, NULL, NULL,
                                      &error);
@@ -98,7 +98,7 @@ locale_to_utf8(const char *localestr)
        if (noconvert)
                return g_strdup(localestr);
 
-       str = g_convert_with_fallback(localestr, strlen(localestr),
+       str = g_convert_with_fallback(localestr, -1,
                                      "utf-8", charset,
                                      NULL, NULL, NULL,
                                      &error);