• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

encoding doubt

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Marshal
Posts: 28225
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic