aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_econv.rb3
-rw-r--r--transcode.c4
3 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index eaf4bb2913..892ccb3674 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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("\"&amp;\e$B$&\e(B&#x2661;&amp;&quot;'\"".force_encoding("iso-2022-jp"),
"&\u3046\u2661&\"'".encode("iso-2022-jp", html: :attr))
+
+ assert_equal("&amp;\u3046\u2661&amp;\"'".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;
}