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 --- osdep/getch2.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'osdep/getch2.c') diff --git a/osdep/getch2.c b/osdep/getch2.c index c104790900..a4226415f0 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -28,6 +28,11 @@ #endif #endif +#if defined(USE_LANGINFO) && defined(USE_ICONV) +#include +#include +#endif + #include #include "keycodes.h" @@ -238,3 +243,16 @@ void getch2_disable(void){ getch2_status=0; } +#ifdef USE_ICONV +char* get_term_charset() +{ + char* charset = NULL; +#ifdef USE_LANGINFO + setlocale(LC_CTYPE, ""); + charset = nl_langinfo(CODESET); + setlocale(LC_CTYPE, "C"); +#endif + return charset; +} +#endif + -- cgit v1.2.3