OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Question about UTF-8

[ Lists Home | Date Index | Thread Index ]

Gustaf Liljegren wrote:

> Consider this document, encoded in UTF-8 with no BOM:
> 
> <?xml version="1.0"?>
> </>
> 
> Is there a safe way for a non-XML-aware text editor to find out that this
> file is using UTF-8?

It is not ambiguous at all what the encoding must be; there's no 
encoding declaration, so it must be UTF-8.  The parser, in order to 
parse, clearly knows this.  For this reason, the encoding is in the 
infoset, since the parser can't not know it.  Whether or not the softare 
you're using exposes this knowledge is another matter.

> 
> There are still a lot of people over here who likes to use ISO 8859-1,
> because they have the conception that '' is written 'ä' in UTF-8. 

The file xml.xml, the original XML 1.0 specification, was encoded in 
8859-1, there's nothing wrong with that, it's a perfectly decent 
encoding if you're working in a European-language context, and in 
practical terms all widely-used XML software supports it just fine.  -Tim






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS