From a188335a339bea5d07f8d79ea105446362f3a95e Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 4 Mar 2007 19:04:08 +0000 Subject: Add code to detect and convert to console codepage on Windows. Patch by Zuxy Meng [zuxy.meng at gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22460 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp_msg.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'mp_msg.c') diff --git a/mp_msg.c b/mp_msg.c index 99c587fb77..cd4fd0ec1d 100644 --- a/mp_msg.c +++ b/mp_msg.c @@ -8,13 +8,10 @@ #include "config.h" -#ifdef USE_LANGINFO -#include -#include -#endif #ifdef USE_ICONV #include #include +extern char* get_term_charset(); #endif #if defined(FOR_MENCODER) || defined(CODECS2HTML) @@ -79,13 +76,8 @@ void mp_msg_init(void){ 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 } -- cgit v1.2.3