[vlc-commits] commit: Text: Fix compilation on non-UTF-8 systems (Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Sat Oct 30 15:43:59 CEST 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Oct 30 12:00:23 2010 +0200| [f4a9f1315dc0865ac0519ba19ba684eaea84625b] | committer: Jean-Baptiste Kempf 

Text: Fix compilation on non-UTF-8 systems

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4a9f1315dc0865ac0519ba19ba684eaea84625b
---

 src/text/unicode.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/text/unicode.c b/src/text/unicode.c
index 35c1361..313bbed 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -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
 }
 



More information about the vlc-commits mailing list