ruby-changes:7663
From: akr <ko1@a...>
Date: Sat, 6 Sep 2008 18:48:46 +0900 (JST)
Subject: [ruby-changes:7663] Ruby:r19184 (trunk): * transcode.c (str_transcode0): check ECONV_HTML_TEXT_ENCODER and
akr 2008-09-06 18:48:32 +0900 (Sat, 06 Sep 2008) New Revision: 19184 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19184 Log: * transcode.c (str_transcode0): check ECONV_HTML_TEXT_ENCODER and ECONV_HTML_ATTR_ENCODER. Modified files: trunk/ChangeLog trunk/test/ruby/test_econv.rb trunk/transcode.c Index: ChangeLog =================================================================== --- ChangeLog (revision 19183) +++ ChangeLog (revision 19184) @@ -1,3 +1,8 @@ +Sat Sep 6 18:47:40 2008 Tanaka Akira <akr@f...> + + * transcode.c (str_transcode0): check ECONV_HTML_TEXT_ENCODER and + ECONV_HTML_ATTR_ENCODER. + Sat Sep 6 18:38:47 2008 Tanaka Akira <akr@f...> * transcode.c (allocate_converted_string): fix overflow condition. Index: test/ruby/test_econv.rb =================================================================== --- test/ruby/test_econv.rb (revision 19183) +++ test/ruby/test_econv.rb (revision 19184) @@ -774,5 +774,8 @@ "&\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 Index: transcode.c =================================================================== --- transcode.c (revision 19183) +++ transcode.c (revision 19184) @@ -2295,7 +2295,9 @@ 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; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/