Not sure where to start.
Overview: I have a big file of Western-encoded messages, you could call it some sorta non-standard blog, marked-up with HTML. Am now trying to clean up things, storing the messages as XML (more specific: as RSS 2.0), and displaying them as HTML. The encoding should change to UTF-8.
Most of the things work, just the UTF-8 encoding of special entities for the XML drives me nuts. I have been deploying the XML::RSS Perl module, which might or might not be a good idea after testing it. E.g. sometimes the encode_output
switch is being ignored depending on which server I execute the script.
It also seems XML::RSS does not correctly support the common way of encoding/decoding UTF-8 entities. In those cases where the mentioned "encode_output" of XML::RSS does work it produces something like this for the lower-case 'a' with two dots on top:
When XML::RSS reads in entities like this it gets correctly decoded. But common RSS readers are not swallowing it.
I have read _thousands_ of websites on the topic, and it _seems_ that the encoding for the above example should have been:
When XML::RSS reads entities like this, something goes wrong and I see funny characters as result. After some frustration I had written the encoding myself like the second version, which solves the encoding part but XML::RSS does not like it.
Question 1: Are both ways above correct when encoding UTF-8 in XML?
Question 2: Is using XML::RSS a bad idea? Any alternatives?
Question 3: How to best encode those entities in HTML for output?
Question 4: Could it be that RSS readers better support decimal encoding, e.g.
than the hexadecimal one, e.g.
Thanks for any hints!! Am stuck here and feel oblivious.