]> git.sesse.net Git - vlc/commitdiff
- unicode.c, wincp.c: compile fix
authorDamien Fouilleul <damienf@videolan.org>
Thu, 15 Mar 2007 17:58:45 +0000 (17:58 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Thu, 15 Mar 2007 17:58:45 +0000 (17:58 +0000)
src/text/unicode.c
src/text/wincp.c

index 8705f3923dd9475b32e666a530e5afcf6b8fc711..bfd51b9e4c5bc4bec7beecf3cb2f8c7d262c1a3d 100644 (file)
@@ -142,13 +142,13 @@ static char *locale_fast (const char *string, vlc_bool_t from)
                                    0, string, -1, NULL, 0);
     wchar_t wide[len];
 
-    MultiByteToWideChar (from ? CP_UTF8 : CP_ACP, 0, string, -1, wide, len);
-    len = 1 + WideCharToMultiByte (p->toCP, 0, wide, -1, NULL, 0, NULL, NULL);
+    MultiByteToWideChar (from ? CP_ACP : CP_UTF8, 0, string, -1, wide, len);
+    len = 1 + WideCharToMultiByte (from ? CP_UTF8 : CP_ACP, 0, wide, -1, NULL, 0, NULL, NULL);
     out = malloc (len);
     if (out == NULL)
         return NULL;
 
-    WideCharToMultiByte (p->toCP, 0, wide, -1, out, len, NULL, NULL);
+    WideCharToMultiByte (from ? CP_UTF8 : CP_ACP, 0, wide, -1, out, len, NULL, NULL);
     return out;
 #else
     return (char *)string;
index d0447e19a22dd1c2ba60611ee3ba6d0023e70e6a..f1ae48de7e7fe1f11bc45416b9215d319fec65c8 100644 (file)
@@ -214,6 +214,7 @@ const char *GetFallbackEncoding( void )
 
     return FindFallbackEncoding (psz_lang);
 #else
+    static char buf[16] = "";
     if (buf[0] == 0)
         snprintf (buf, sizeof (buf), "CP%u", GetACP ());
     return buf;