]> git.sesse.net Git - vlc/commitdiff
Text: Fix compilation on non-UTF-8 systems
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 30 Oct 2010 10:00:23 +0000 (12:00 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 30 Oct 2010 13:43:50 +0000 (15:43 +0200)
src/text/unicode.c

index 35c1361f9998683607acf084815950a5f80efc4f..313bbede7917130e853b4f7a37f7531956b4e3b6 100644 (file)
@@ -73,7 +73,7 @@ char *FromLocale (const char *locale)
 #ifdef ASSUME_UTF8
     return (char *)locale;
 #else
-    return locale ? FromCharset ("", locale) : NULL;
+    return locale ? FromCharset ("", locale, strlen(locale)) : NULL;
 #endif
 }
 
@@ -91,7 +91,7 @@ char *FromLocaleDup (const char *locale)
 #ifdef ASSUME_UTF8
     return strdup (locale);
 #else
-    return FromCharset ("", locale);
+    return FromCharset ("", locale, strlen(locale));
 #endif
 }
 
@@ -110,7 +110,8 @@ char *ToLocale (const char *utf8)
 #ifdef ASSUME_UTF8
     return (char *)utf8;
 #else
-    return utf8 ? ToCharset ("", utf8) : NULL;
+    size_t outsize;
+    return utf8 ? ToCharset ("", utf8, &outsize) : NULL;
 #endif
 }
 
@@ -129,7 +130,8 @@ char *ToLocaleDup (const char *utf8)
 #ifdef ASSUME_UTF8
     return strdup (utf8);
 #else
-    return ToCharset ("", utf8);
+    size_t outsize;
+    return ToCharset ("", utf8, &outsize);
 #endif
 }