[vlc-commits] Win32: use fputws instead of ToANSI+fputs

Jean-Baptiste Kempf git at videolan.org
Wed Mar 20 11:41:47 CET 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Mar 20 00:10:06 2013 +0100| [7c093d51ef9347bafaf7e2baf5b0a93da3c22d2b] | committer: Jean-Baptiste Kempf

Win32: use fputws instead of ToANSI+fputs

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

 src/text/unicode.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/text/unicode.c b/src/text/unicode.c
index dd29bfa..65a158d 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -81,12 +81,11 @@ int utf8_vfprintf( FILE *stream, const char *fmt, va_list ap )
         }
     }
 #endif
-
-    char *ansi = ToANSI (str);
-    if (ansi != NULL)
+    wchar_t *wide = ToWide(str);
+    if (likely(wide != NULL))
     {
-        fputs (ansi, stream);
-        free (ansi);
+        res = fputws(wide, stream);
+        free(wide);
     }
     else
         res = -1;



More information about the vlc-commits mailing list