comparison 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
comparison
equal deleted inserted replaced
22441:6f183c95aafc 22442:56a0b0f8a66e
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "config.h" 9 #include "config.h"
10 10
11 #ifdef USE_LANGINFO
12 #include <locale.h>
13 #include <langinfo.h>
14 #endif
15 #ifdef USE_ICONV 11 #ifdef USE_ICONV
16 #include <iconv.h> 12 #include <iconv.h>
17 #include <errno.h> 13 #include <errno.h>
14 extern char* get_term_charset();
18 #endif 15 #endif
19 16
20 #if defined(FOR_MENCODER) || defined(CODECS2HTML) 17 #if defined(FOR_MENCODER) || defined(CODECS2HTML)
21 #undef HAVE_NEW_GUI 18 #undef HAVE_NEW_GUI
22 #endif 19 #endif
77 verbose = atoi(env); 74 verbose = atoi(env);
78 for(i=0;i<MSGT_MAX;i++) mp_msg_levels[i] = -2; 75 for(i=0;i<MSGT_MAX;i++) mp_msg_levels[i] = -2;
79 mp_msg_levels[MSGT_IDENTIFY] = -1; // no -identify output by default 76 mp_msg_levels[MSGT_IDENTIFY] = -1; // no -identify output by default
80 #ifdef USE_ICONV 77 #ifdef USE_ICONV
81 mp_msg_charset = getenv("MPLAYER_CHARSET"); 78 mp_msg_charset = getenv("MPLAYER_CHARSET");
82 #ifdef USE_LANGINFO 79 if (!mp_msg_charset)
83 if (!mp_msg_charset) { 80 mp_msg_charset = get_term_charset();
84 setlocale(LC_CTYPE, "");
85 mp_msg_charset = nl_langinfo(CODESET);
86 setlocale(LC_CTYPE, "C");
87 }
88 #endif
89 #endif 81 #endif
90 } 82 }
91 83
92 int mp_msg_test(int mod, int lev) 84 int mp_msg_test(int mod, int lev)
93 { 85 {