diff mp_msg.c @ 22442:56a0b0f8a66e

Add code to detect and convert to console codepage on Windows. Patch by Zuxy Meng [zuxy.meng at gmail com]
author reimar
date Sun, 04 Mar 2007 19:04:08 +0000
parents b79ca70e0cad
children 129139491fab
line wrap: on
line diff
--- a/mp_msg.c	Sun Mar 04 18:55:44 2007 +0000
+++ b/mp_msg.c	Sun Mar 04 19:04:08 2007 +0000
@@ -8,13 +8,10 @@
 
 #include "config.h"
 
-#ifdef USE_LANGINFO
-#include <locale.h>
-#include <langinfo.h>
-#endif
 #ifdef USE_ICONV
 #include <iconv.h>
 #include <errno.h>
+extern char* get_term_charset();
 #endif
 
 #if defined(FOR_MENCODER) || defined(CODECS2HTML)
@@ -79,13 +76,8 @@
     mp_msg_levels[MSGT_IDENTIFY] = -1; // no -identify output by default
 #ifdef USE_ICONV
     mp_msg_charset = getenv("MPLAYER_CHARSET");
-#ifdef USE_LANGINFO
-    if (!mp_msg_charset) {
-      setlocale(LC_CTYPE, "");
-      mp_msg_charset = nl_langinfo(CODESET);
-      setlocale(LC_CTYPE, "C");
-    }
-#endif
+    if (!mp_msg_charset)
+      mp_msg_charset = get_term_charset();
 #endif
 }