summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-12-24 11:42:15 +0900
committerNobuyoshi Nakada <nobu.nakada@gmail.com>2024-12-24 13:25:55 +0900
commitfb82f3a632fa07dd270ed188cd6ce751ecabcb84 (patch)
treea89f58d4b453fec81791cac6d341f2f3eb102f8f /test/ruby
parent42026ec3da6acb2c398bea8c8dc97103a7c936ec (diff)
Win32: Defer change of timezone name encoding after 3.4
This change will be merged into 3.5 along with other encoding, command line, environment variables, etc. Revert following commits: - bd831bcca534955533d9135d8c2f22d7ae5b9aa8 [Bug #20929] Win32: Use `wcsftime` - 1c15f641cc2bb88fa88123a11036ed58fbf9aa6d [Bug #20929] Win32: Encode timezone name in UTF-8 - 78762b52185aa80ee55c0d49b495aceed863dce2 [Bug #20929] Fix `assert_zone_encoding`
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12448
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_time.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 98e4c333a5..333edb8021 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -717,15 +717,13 @@ class TestTime < Test::Unit::TestCase
assert_equal("2000-01-01 09:12:34 +091234", t2000.localtime(9*3600+12*60+34).inspect)
end
- FIXED_ZONE_ENCODING = (Encoding::UTF_8 if /mswin|mingw/.match?(RUBY_PLATFORM))
-
def assert_zone_encoding(time)
zone = time.zone
assert_predicate(zone, :valid_encoding?)
if zone.ascii_only?
assert_equal(Encoding::US_ASCII, zone.encoding)
else
- enc = FIXED_ZONE_ENCODING || Encoding.find('locale')
+ enc = Encoding.default_internal || Encoding.find('locale')
assert_equal(enc, zone.encoding)
end
end