ruby-changes:9801
From: usa <ko1@a...>
Date: Mon, 5 Jan 2009 17:45:20 +0900 (JST)
Subject: [ruby-changes:9801] Ruby:r21342 (trunk): * encoding.c (rb_locale_charmap): use GetConsoleCP() instead of
usa 2009-01-05 17:44:10 +0900 (Mon, 05 Jan 2009) New Revision: 21342 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21342 Log: * encoding.c (rb_locale_charmap): use GetConsoleCP() instead of GetACP() because external encoding should be console's one. * encoding.c (rb_filesystem_encoding): use GetOEMCP() instead of GetACP() because VFAT/FAT32 uses OEM CP. Modified files: trunk/ChangeLog trunk/encoding.c Index: encoding.c =================================================================== --- encoding.c (revision 21341) +++ encoding.c (revision 21342) @@ -1034,7 +1034,7 @@ enc = rb_default_external_encoding(); #elif defined _WIN32 || defined __CYGWIN__ char cp[sizeof(int) * 8 / 3 + 4]; - snprintf(cp, sizeof cp, "CP%d", GetACP()); + snprintf(cp, sizeof cp, "CP%d", GetOEMCP()); enc = rb_enc_find(cp); #elif defined __APPLE__ enc = rb_enc_find("UTF8-MAC"); @@ -1218,7 +1218,7 @@ codeset = nl_langinfo(CODESET); return rb_usascii_str_new2(codeset); #elif defined _WIN32 - return rb_sprintf("CP%d", GetACP()); + return rb_sprintf("CP%d", GetConsoleCP()); #else return Qnil; #endif Index: ChangeLog =================================================================== --- ChangeLog (revision 21341) +++ ChangeLog (revision 21342) @@ -1,3 +1,11 @@ +Mon Jan 5 17:38:40 2009 NAKAMURA Usaku <usa@r...> + + * encoding.c (rb_locale_charmap): use GetConsoleCP() instead of + GetACP() because external encoding should be console's one. + + * encoding.c (rb_filesystem_encoding): use GetOEMCP() instead of + GetACP() because VFAT/FAT32 uses OEM CP. + Mon Jan 5 16:26:48 2009 Nobuyoshi Nakada <nobu@r...> * encoding.c (rb_filesystem_encoding): use ANSI codepage for file -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/