* time.c (time_zone): use rb_locale_str_new_cstr to set encoding

as locale and convert its content to internal encoding.
  [ruby-core:33278]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-11-22 05:25:15 +00:00
parent 3002e5e1f9
commit 33356ff75b
3 changed files with 10 additions and 2 deletions

View file

@ -465,6 +465,7 @@ class TestTime < Test::Unit::TestCase
assert_equal(1, T2000.yday)
assert_equal(false, T2000.isdst)
assert_equal("UTC", T2000.zone)
assert_equal(Encoding.find("locale"), T2000.zone.encoding)
assert_equal(0, T2000.gmt_offset)
assert(!T2000.sunday?)
assert(!T2000.monday?)
@ -486,6 +487,7 @@ class TestTime < Test::Unit::TestCase
assert_equal(t.yday, Time.at(946684800).yday)
assert_equal(t.isdst, Time.at(946684800).isdst)
assert_equal(t.zone, Time.at(946684800).zone)
assert_equal(Encoding.find("locale"), Time.at(946684800).zone.encoding)
assert_equal(t.gmt_offset, Time.at(946684800).gmt_offset)
assert_equal(t.sunday?, Time.at(946684800).sunday?)
assert_equal(t.monday?, Time.at(946684800).monday?)