18 #ifdef HAVE_LANGINFO_H 25 #if defined NO_LOCALE_CHARMAP 26 # error NO_LOCALE_CHARMAP defined 27 #elif defined _WIN32 || defined __CYGWIN__ 28 const char *codeset = 0;
29 char cp[
sizeof(int) * 3 + 4];
35 UINT codepage = GetConsoleCP();
36 if (!codepage) codepage = GetACP();
37 snprintf(cp,
sizeof(cp),
"CP%d", codepage);
41 #elif defined HAVE_LANGINFO_H 43 codeset = nl_langinfo(CODESET);
54 #if defined NO_LOCALE_CHARMAP 55 # error NO_LOCALE_CHARMAP defined 56 #elif defined _WIN32 || defined __CYGWIN__ 57 char cp[
sizeof(int) * 8 / 3 + 4];
58 snprintf(cp,
sizeof cp,
"CP%d", AreFileApisANSI() ? GetACP() : GetOEMCP());
60 if (idx < 0) idx = ENCINDEX_ASCII;
#define rb_usascii_str_new2
const char * nl_langinfo_codeset(void)
rb_encoding * rb_default_external_encoding(void)
VALUE rb_locale_charmap(VALUE klass)
int Init_enc_set_filesystem_encoding(void)
#define rb_enc_to_index(enc)
int rb_enc_find_index(const char *name)