mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Revert "merge revision(s) e86c1f6fc53433ef5c82ed2b7a4cc9a12c153e4c,f6539202c52a051a4e6946a318a1d9cd29002990: [Backport #1205]"
This reverts commit e62cccaeb0
.
This commit is contained in:
parent
e62cccaeb0
commit
69fd46f252
3 changed files with 1 additions and 29 deletions
|
@ -126,28 +126,6 @@ class TestTranscode < Test::Unit::TestCase
|
|||
assert_equal("D\xFCrst".force_encoding('iso-8859-2'), "D\xFCrst".encode('iso-8859-2', 'iso-8859-1'))
|
||||
end
|
||||
|
||||
def test_encode_xml_multibyte
|
||||
encodings = %w'UTF-8 UTF-16LE UTF-16BE UTF-32LE UTF-32BE'
|
||||
encodings.each do |src_enc|
|
||||
encodings.each do |dst_enc|
|
||||
escaped = "<>".encode(src_enc).encode(dst_enc, :xml=>:text)
|
||||
assert_equal("<>", escaped.encode('UTF-8'), "failed encoding #{src_enc} to #{dst_enc} with xml: :text")
|
||||
|
||||
escaped = '<">'.encode(src_enc).encode(dst_enc, :xml=>:attr)
|
||||
assert_equal('"<">"', escaped.encode('UTF-8'), "failed encoding #{src_enc} to #{dst_enc} with xml: :attr")
|
||||
|
||||
escaped = "<>".encode(src_enc).force_encoding("UTF-8").encode(dst_enc, src_enc, :xml=>:text)
|
||||
assert_equal("<>", escaped.encode('UTF-8'), "failed encoding #{src_enc} to #{dst_enc} with xml: :text")
|
||||
|
||||
escaped = '<">'.encode(src_enc).force_encoding("UTF-8").encode(dst_enc, src_enc, :xml=>:attr)
|
||||
assert_equal('"<">"', escaped.encode('UTF-8'), "failed encoding #{src_enc} to #{dst_enc} with xml: :attr")
|
||||
end
|
||||
end
|
||||
# regression test; U+6E7F (湿) uses the same bytes in ISO-2022-JP as "<>"
|
||||
assert_equal( "<>\u6E7F", "<>\u6E7F".encode("ISO-2022-JP").encode("ISO-2022-JP", :xml=>:text).encode("UTF-8"))
|
||||
assert_equal("\"<>\u6E7F\"", "<>\u6E7F".encode("ISO-2022-JP").encode("ISO-2022-JP", :xml=>:attr).encode("UTF-8"))
|
||||
end
|
||||
|
||||
def test_ascii_range
|
||||
encodings = [
|
||||
'US-ASCII', 'ASCII-8BIT',
|
||||
|
|
|
@ -2719,12 +2719,6 @@ str_transcode0(int argc, VALUE *argv, VALUE *self, int ecflags, VALUE ecopts)
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (senc && denc && !rb_enc_asciicompat(senc) && !rb_enc_asciicompat(denc)) {
|
||||
rb_encoding *utf8 = rb_utf8_encoding();
|
||||
str = rb_str_conv_enc(str, senc, utf8);
|
||||
senc = utf8;
|
||||
sname = "UTF-8";
|
||||
}
|
||||
if (encoding_equal(sname, dname)) {
|
||||
sname = "";
|
||||
dname = "";
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
|
||||
#define RUBY_VERSION_TEENY 2
|
||||
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
|
||||
#define RUBY_PATCHLEVEL 106
|
||||
#define RUBY_PATCHLEVEL 105
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2021
|
||||
#define RUBY_RELEASE_MONTH 7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue