summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-24 08:42:52 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-24 08:42:52 +0000
commit5d8bf153429dce73dde8a256580ac1412e469c02 (patch)
tree45c04212e7289321ff7917da81c6070068637c5d /time.c
parent6d90e595620d1b150aaf7c543ac4d56666d841b3 (diff)
merge revision(s) 49693,46907,49702,49710: [Backport #10887]
* time.c: Zone encoding should be US-ASCII if all 7-bits. Fix r46907. * test/ruby/test_time.rb, test/ruby/test_time_tz.rb: Update tests. * time.c (time_zone_name): should be US-ASCII only if all 7-bits, otherwise locale encoding. [ruby-core:68230] [Bug #10887] * time.c (time_zone_name): should be US-ASCII only if all 7-bits, otherwise locale encoding. [ruby-core:68230] [Bug #10887] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/time.c b/time.c
index 044a049981..4af193d19a 100644
--- a/time.c
+++ b/time.c
@@ -4198,6 +4198,9 @@ time_zone_name(const char *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;
}