From 020fcc95fe948f65b03609d445a6cf1bc0c06dc5 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 15 Dec 2014 07:19:25 +0000 Subject: string.c: fix coderange for non-endianness string * string.c (rb_enc_str_coderange): dummy wchar, non-endianness encoding string cannot be ascii only. [ruby-core:66835] [Bug #10598] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index bbaf31f52a..99450723cf 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -260,6 +260,14 @@ class TestM17N < Test::Unit::TestCase end end + def test_utf_without_bom_asciionly + bug10598 = '[ruby-core:66835] [Bug #10598]' + encs = [Encoding::UTF_16, Encoding::UTF_32].find_all {|enc| + "abcd".force_encoding(enc).ascii_only? + } + assert_empty(encs, bug10598) + end + def test_object_utf16_32_inspect EnvUtil.suppress_warning do begin -- cgit v1.2.3