From: "Mark S." Date: 2012-11-05T11:18:33+09:00 Subject: Re: REXML & HTMLentities incorrectly map to UTF-8 Kouhei Sutou wrote in post #1082578: > Could you show me a sample Ruby code? > If I can reproduce your problem with the code on my machine, I > will fix the problem and the fix will be shipped in Ruby 2.0.0. Here is some code to produce the problem, plus the input xml and the output xml that I got when running the code. If you view the output in an editor that shows hex code, you'll see that the apostrophe in "fund's" becomes transliterated to char point C292 -- which is just an unused control code. The entity code used for the apostrophe is ’ which my Oreilly HTML book indicates should indeed be rendered as an apostrophe. But the problem is even worse. It turns out that if there is any HTML tagging inside of the CDATA ... REXML deletes the data! Sometimes it even hangs up with a "tree parsing error" (not exact text) with no indication what source tag is giving the problem. (Sorry, can't provide that sample input since its 15megs of semi-private data). Thanks, Mark Attachments: http://www.ruby-forum.com/attachment/7855/example-REXML-problem.rb http://www.ruby-forum.com/attachment/7856/sample-REXML-output.xml http://www.ruby-forum.com/attachment/7857/sample-REXML-input.xml -- Posted via http://www.ruby-forum.com/.