Project

General

Profile

Bug #4854 ยป encoding.codepage.patch

rafal.bigaj (Rafal Bigaj), 06/08/2011 04:38 PM

View differences:

encoding.c (working copy)
const char *codeset = nl_langinfo_codeset();
char cp[sizeof(int) * 3 + 4];
if (!codeset) {
snprintf(cp, sizeof(cp), "CP%d", GetConsoleCP());
UINT codepage = GetConsoleCP();
if(codepage==0) {
codepage = GetACP();
}
snprintf(cp, sizeof(cp), "CP%d", codepage);
codeset = cp;
}
return rb_usascii_str_new2(codeset);
    (1-1/1)