summaryrefslogtreecommitdiffstats
path: root/mp_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mp_msg.c')
-rw-r--r--mp_msg.c14
1 files changed, 3 insertions, 11 deletions
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 <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 @@ 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
}