summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--time.c5
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2493da9297..78910428dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Feb 24 11:49:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* string.c (chompped_length): enable smart chomp for all non-dummy
diff --git a/time.c b/time.c
index 51939111b3..4af193d19a 100644
--- a/time.c
+++ b/time.c
@@ -4194,10 +4194,13 @@ time_isdst(VALUE time)
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;
}