зеркало из https://github.com/github/ruby.git
* transcode.c (rb_econv_insert_output): "readagain" part should be
after replacement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
be2fc605fc
Коммит
a98bb55e01
|
@ -1,3 +1,8 @@
|
|||
Mon Sep 8 23:05:42 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* transcode.c (rb_econv_insert_output): "readagain" part should be
|
||||
after replacement.
|
||||
|
||||
Mon Sep 8 22:30:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* dir.c (dir_initialize): rename option name of Dir.open
|
||||
|
|
|
@ -798,4 +798,9 @@ class TestEncodingConverter < Test::Unit::TestCase
|
|||
assert_equal("&\u3046\u2661&\"'".force_encoding("utf-8"),
|
||||
"&\u3046\u2661&\"'".encode("utf-8", xml: :text))
|
||||
end
|
||||
|
||||
def test_iso2022jp_invalid_replace
|
||||
assert_equal("?x".force_encoding("iso-2022-jp"),
|
||||
"\222\xA1x".encode("iso-2022-jp", "stateless-iso-2022-jp", :invalid => :replace))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1578,13 +1578,13 @@ rb_econv_insert_output(rb_econv_t *ec,
|
|||
}
|
||||
}
|
||||
|
||||
memcpy(*data_end_p, insert_str, insert_len);
|
||||
*data_end_p += insert_len;
|
||||
if (tc && tc->transcoder->stateful_type == stateful_encoder) {
|
||||
memcpy(*data_end_p, TRANSCODING_READBUF(tc)+tc->recognized_len, tc->readagain_len);
|
||||
*data_end_p += tc->readagain_len;
|
||||
tc->readagain_len = 0;
|
||||
}
|
||||
memcpy(*data_end_p, insert_str, insert_len);
|
||||
*data_end_p += insert_len;
|
||||
|
||||
if (insert_str != str && insert_str != insert_buf)
|
||||
xfree((void*)insert_str);
|
||||
|
|
Загрузка…
Ссылка в новой задаче