Hello fellow monks, I once again humbly beg for assistance. This question is not strictly perl related, although it is running through a system using mod_perl and HTML::Mason to fetch the data that is an issue.

I need to be able to fetch Unicode data using internet explorer in an XML document. I'm trying to add some AJAX functionality to my site and Internet Explorer is complaining about my unicode characters in my XML. Mozilla likes it just fine, and I would assume that as soon as I can pull up the page OK in the browser window that my AJAX problem will go away as well and it will get the data directly.

Internet Explorer says "The XML page cannot be displayed" and "An invalid character was found in text content. Error processing resource"

I'm using HTML::Mason's |h escaping, which should be calling HTML::Entities::encode() and making the data happy.

I've tried setting a content-type using $r->content_type of "text/xml; charset=UTF-8", as well as having <?xml version="1.0" encoding="UTF-8"?> as the first line of my XML file - but it doesn't like it. IE breaks on the UTF 8 encoded character.

I suppose as a workaround I could just load the text and do some regex splitting action to get the pieces of data, but I would prefer to use XML and let the browser do the heavy lifting for me.

Thank you in advance for your attention to my problem


In reply to XML, Unicode, and Internet Explorer by Tuppence

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.