• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

encoding doubt

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an XML file which contains registered symbol (R and a circle around it).

I am aware that this symbol is in UTF-8 encoding and not in ISO-8859-1.

But when I use ISO-8859-1 encoding scheme for my XML file, browser displays this file properly. But when I use UTF-8, it says:


The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

An invalid character was found in text content. Error processing resource 'file:///


Why so?

Thanks.

 
Paul Clapham
Sheriff
Posts: 20990
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, first of all you can put any character into an XML document regardless of the encoding it uses, because you can always use character entities like "&#xxxx;". And well-written XML software will automatically output characters in that way if the target encoding doesn't support them.

The answer to you main question, I think, is that the prolog of the XML document should declare the encoding actually used to write the document. Declaring <?xml encoding="UTF-8"?> is going to cause problems if you don't actually use UTF-8 to write the document.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic