diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_econv.rb | 3 | ||||
-rw-r--r-- | transcode.c | 4 |
3 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Sat Sep 6 18:47:40 2008 Tanaka Akira <akr@fsij.org> + + * transcode.c (str_transcode0): check ECONV_HTML_TEXT_ENCODER and + ECONV_HTML_ATTR_ENCODER. + Sat Sep 6 18:38:47 2008 Tanaka Akira <akr@fsij.org> * transcode.c (allocate_converted_string): fix overflow condition. diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 3f82d2742c..2fcc6ab786 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -774,5 +774,8 @@ class TestEncodingConverter < Test::Unit::TestCase "&\u3046\u2665&\"'".encode("iso-2022-jp", html: :text)) assert_equal("\"&\e$B$&\e(B♡&"'\"".force_encoding("iso-2022-jp"), "&\u3046\u2661&\"'".encode("iso-2022-jp", html: :attr)) + + assert_equal("&\u3046\u2661&\"'".force_encoding("utf-8"), + "&\u3046\u2661&\"'".encode("utf-8", html: :text)) end end diff --git a/transcode.c b/transcode.c index ccb54dfff0..a0bac4f9d5 100644 --- a/transcode.c +++ b/transcode.c @@ -2295,7 +2295,9 @@ str_transcode0(int argc, VALUE *argv, VALUE *self, int ecflags, VALUE ecopts) if ((ecflags & (ECONV_UNIVERSAL_NEWLINE_DECODER| ECONV_CRLF_NEWLINE_ENCODER| - ECONV_CR_NEWLINE_ENCODER)) == 0) { + ECONV_CR_NEWLINE_ENCODER| + ECONV_HTML_TEXT_ENCODER| + ECONV_HTML_ATTR_ENCODER)) == 0) { if (senc && senc == denc) { return -1; } |