Index: mp_msg.c =================================================================== --- mp_msg.c £¨ÐÞ¶©°æ 22020£© +++ mp_msg.c £¨¹¤×÷¿½±´£© @@ -27,6 +27,10 @@ #endif #include "mp_msg.h" +#ifdef __MINGW32__ +#include +#endif + /* maximum message length of mp_msg */ #define MSGSIZE_MAX 3072 @@ -72,6 +76,30 @@ void mp_msg_init(void){ int i; char *env = getenv("MPLAYER_VERBOSE"); +#if defined(USE_ICONV) && defined(__MINGW32__) && !defined(USE_LANGINFO) + static char codepage[10]; + unsigned cpno; + const struct { + unsigned cp; + char* alias; + } cp_alias[] = { + { 20127, "ASCII" }, + { 20866, "KOI8-R" }, + { 21866, "KOI8-RU" }, + { 28591, "ISO-8859-1" }, + { 28592, "ISO-8859-2" }, + { 28593, "ISO-8859-3" }, + { 28594, "ISO-8859-4" }, + { 28595, "ISO-8859-5" }, + { 28596, "ISO-8859-6" }, + { 28597, "ISO-8859-7" }, + { 28598, "ISO-8859-8" }, + { 28599, "ISO-8859-9" }, + { 28605, "ISO-8859-15" }, + { 65001, "UTF-8" }, + { 0, NULL } + }; +#endif if (env) verbose = atoi(env); for(i=0;i= cp_alias[0].cp) { + unsigned cur_cp; + i = 0; + while (cur_cp = cp_alias[i].cp) { + if (cpno == cur_cp) { + mp_msg_charset = cp_alias[i].alias; + return; + } + i++; + } + } + + snprintf(codepage, sizeof(codepage), "CP%u", cpno); + mp_msg_charset = codepage; + return; #endif #endif }