ruby-changes:37629
From: nobu <ko1@a...>
Date: Tue, 24 Feb 2015 11:50:05 +0900 (JST)
Subject: [ruby-changes:37629] nobu:r49710 (trunk): time.c: locale time zone name
nobu 2015-02-24 11:49:51 +0900 (Tue, 24 Feb 2015) New Revision: 49710 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49710 Log: time.c: locale time zone name * time.c (time_zone_name): should be US-ASCII only if all 7-bits, otherwise locale encoding. [ruby-core:68230] [Bug #10887] Modified files: trunk/ChangeLog trunk/time.c Index: time.c =================================================================== --- time.c (revision 49709) +++ time.c (revision 49710) @@ -4194,10 +4194,13 @@ time_isdst(VALUE time) https://github.com/ruby/ruby/blob/trunk/time.c#L4194 static VALUE time_zone_name(const char *zone) { - VALUE name = rb_usascii_str_new_cstr(zone); /* zone may be ASCII-8BIT on Windows */ + VALUE name = rb_str_new_cstr(zone); if (!rb_enc_str_asciionly_p(name)) { name = rb_external_str_with_enc(name, rb_locale_encoding()); } + else { + rb_enc_associate(name, rb_usascii_encoding()); + } return name; } Index: ChangeLog =================================================================== --- ChangeLog (revision 49709) +++ ChangeLog (revision 49710) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Feb 24 11:49:48 2015 Nobuyoshi Nakada <nobu@r...> + + * time.c (time_zone_name): should be US-ASCII only if all 7-bits, + otherwise locale encoding. [ruby-core:68230] [Bug #10887] + +Tue Feb 24 11:49:43 2015 Nobuyoshi Nakada <nobu@r...> + + * time.c (time_zone_name): should be US-ASCII only if all 7-bits, + otherwise locale encoding. [ruby-core:68230] [Bug #10887] + Tue Feb 24 09:47:07 2015 Nobuyoshi Nakada <nobu@r...> * string.c (chompped_length): enable smart chomp for all non-dummy -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/