X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftext%2Fwincp.c;h=97dfc6158a99b570c75ab67da038214678b816e6;hb=46f77d8add706d1d5a7f064039f63ffd219aa826;hp=318b5e6a7edfada46f294a232a3c2f361a9f576b;hpb=4f32396e885b5e7074039c426cae5c466cc55ca1;p=vlc diff --git a/src/text/wincp.c b/src/text/wincp.c index 318b5e6a7e..97dfc6158a 100644 --- a/src/text/wincp.c +++ b/src/text/wincp.c @@ -22,7 +22,11 @@ /*** We need your help to complete this file!! Look for FIXME ***/ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include #ifndef WIN32 # include @@ -97,7 +101,7 @@ static const char *FindFallbackEncoding (const char *locale) /* Hebrew (ISO-8859-8) */ if (!locale_match ("he" "iw" "yi", locale)) - return "CP1255"; // Compatible Microsoft superset + return "ISO-8859-8"; // CP1255 is reportedly screwed up /* Latin-5 Turkish (ISO-8859-9) */ if (!locale_match ("tr" "ku", locale)) @@ -204,8 +208,20 @@ const char *GetFallbackEncoding( void ) return FindFallbackEncoding (psz_lang); #else static char buf[16] = ""; + if (buf[0] == 0) - snprintf (buf, sizeof (buf), "CP%u", GetACP ()); + { + int cp = GetACP (); + + switch (cp) + { + case 1255: // Hebrew, CP1255 screws up somewhat + strcpy (buf, "ISO-8859-8"); + break; + default: + snprintf (buf, sizeof (buf), "CP%u", cp); + } + } return buf; #endif }