mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/date/date_core.c (Date::(ABBR_)?(MONTH|DAY)NAMES): should be usascii.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4dbc9af8af
commit
a6567f2b99
3 changed files with 18 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Sat Jun 11 19:34:51 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
|
* ext/date/date_core.c (Date::(ABBR_)?(MONTH|DAY)NAMES): should be usascii.
|
||||||
|
|
||||||
Sat Jun 11 19:24:33 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
Sat Jun 11 19:24:33 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* ext/date/date_core.c: rewrote doc.
|
* ext/date/date_core.c: rewrote doc.
|
||||||
|
|
|
@ -8114,7 +8114,7 @@ mk_ary_of_str(long len, const char *a[])
|
||||||
if (!a[i])
|
if (!a[i])
|
||||||
e = Qnil;
|
e = Qnil;
|
||||||
else {
|
else {
|
||||||
e = rb_str_new2(a[i]);
|
e = rb_usascii_str_new2(a[i]);
|
||||||
rb_obj_freeze(e);
|
rb_obj_freeze(e);
|
||||||
}
|
}
|
||||||
rb_ary_push(o, e);
|
rb_ary_push(o, e);
|
||||||
|
|
|
@ -385,6 +385,19 @@ class TestSH < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_enc
|
def test_enc
|
||||||
|
Date::MONTHNAMES.each do |s|
|
||||||
|
assert_equal(Encoding::US_ASCII, s.encoding) if s
|
||||||
|
end
|
||||||
|
Date::DAYNAMES.each do |s|
|
||||||
|
assert_equal(Encoding::US_ASCII, s.encoding) if s
|
||||||
|
end
|
||||||
|
Date::ABBR_MONTHNAMES.each do |s|
|
||||||
|
assert_equal(Encoding::US_ASCII, s.encoding) if s
|
||||||
|
end
|
||||||
|
Date::ABBR_DAYNAMES.each do |s|
|
||||||
|
assert_equal(Encoding::US_ASCII, s.encoding) if s
|
||||||
|
end
|
||||||
|
|
||||||
h = Date._strptime('15:43+09:00'.force_encoding('euc-jp'), '%R%z')
|
h = Date._strptime('15:43+09:00'.force_encoding('euc-jp'), '%R%z')
|
||||||
assert_equal(Encoding::EUC_JP, h[:zone].encoding)
|
assert_equal(Encoding::EUC_JP, h[:zone].encoding)
|
||||||
h = Date._strptime('15:43+09:00'.force_encoding('ascii-8bit'), '%R%z')
|
h = Date._strptime('15:43+09:00'.force_encoding('ascii-8bit'), '%R%z')
|
||||||
|
|
Loading…
Add table
Reference in a new issue