17 #ifdef HAVE_LANGINFO_H 21 #if defined _WIN32 || defined __CYGWIN__ 22 #define SIZEOF_CP_NAME ((sizeof(UINT) * 8 / 3) + 4) 23 #define CP_FORMAT(buf, codepage) snprintf(buf, sizeof(buf), "CP%u", (codepage)) 29 #if defined NO_LOCALE_CHARMAP 30 # error NO_LOCALE_CHARMAP defined 31 #elif defined _WIN32 || defined __CYGWIN__ 32 const char *codeset = 0;
33 char cp[SIZEOF_CP_NAME];
39 UINT codepage = GetConsoleCP();
40 if (!codepage) codepage = GetACP();
41 CP_FORMAT(cp, codepage);
44 return (*conv)(codeset);
45 #elif defined HAVE_LANGINFO_H 47 codeset = nl_langinfo(CODESET);
48 return (*conv)(codeset);
101 #if defined NO_LOCALE_CHARMAP 102 # error NO_LOCALE_CHARMAP defined 104 char cp[SIZEOF_CP_NAME];
105 CP_FORMAT(cp, AreFileApisANSI() ? GetACP() : GetOEMCP());
108 #elif defined __CYGWIN__ #define ENCINDEX_US_ASCII
const char * nl_langinfo_codeset(void)
rb_encoding * rb_default_external_encoding(void)
int rb_enc_to_index(rb_encoding *enc)
static VALUE enc_find_index(const char *name)
int rb_locale_charmap_index(void)
VALUE rb_locale_charmap(VALUE klass)
int Init_enc_set_filesystem_encoding(void)
int rb_enc_find_index(const char *name)
static VALUE locale_charmap(VALUE(*conv)(const char *))
VALUE rb_usascii_str_new_cstr(const char *)