зеркало из https://github.com/github/ruby.git
* encoding.c (rb_enc_compatible): return ASCII-8BIT even if 2nd string
is ascii only string. [ruby-core:42354] [Bug #5968] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
546eeb5f4b
Коммит
b346d7a69c
|
@ -1,3 +1,8 @@
|
|||
Mon Feb 6 00:16:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_enc_compatible): return ASCII-8BIT even if 2nd string
|
||||
is ascii only string. [ruby-core:42354] [Bug #5968]
|
||||
|
||||
Fri Feb 3 07:16:47 2012 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/webrick.rb: Moved proxy rewriting to WEBrick::HTTPProxy.
|
||||
|
|
|
@ -812,7 +812,6 @@ rb_enc_compatible(VALUE str1, VALUE str2)
|
|||
if (cr2 == ENC_CODERANGE_7BIT) return enc1;
|
||||
}
|
||||
if (cr2 == ENC_CODERANGE_7BIT) {
|
||||
if (idx1 == ENCINDEX_ASCII) return enc2;
|
||||
return enc1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,5 +109,8 @@ class TestEncoding < Test::Unit::TestCase
|
|||
ua = "abc".force_encoding(Encoding::UTF_8)
|
||||
assert_equal(Encoding::UTF_8, Encoding.compatible?(ua, :abc))
|
||||
assert_equal(nil, Encoding.compatible?(ua, 1))
|
||||
bin = "a".force_encoding(Encoding::ASCII_8BIT)
|
||||
asc = "b".force_encoding(Encoding::US_ASCII)
|
||||
assert_equal(Encoding::ASCII_8BIT, Encoding.compatible?(bin, asc))
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче