Re: [Geopriv] Domain identifier in common policy
Andrew Newton <[email protected]>
| Newsgroups | gmane.ietf.simple,gmane.ietf.geopriv |
|---|---|
| Message-ID | <[email protected]> |
If it doesn't support UTF-16 as the source encoding, it is not compliant with the XML standard. BTW, thanks for the reference point with PHP. I started looking around to see what various parsers using languages without native Unicode do. Both libxml2 and Xerces-C define datatypes for xml character data. libxml2 always hands the application UTF-8 but it supports UTF-16 as a source encoding (making one draw the conclusion that it transcodes to UTF-8 when UTF-8 is not the source encoding). Expat does the same, but there is a compile-time option to have the parser hand the application UTF-16 instead of UTF-8. From what I can tell, PHP is the exception and not the rule. -andy On Jan 6, 2006, at 9:23 AM, Henning Schulzrinne wrote: > FWIW, I just picked the first XML application that came to mind, in > PHP. It doesn't support UTF-16. Source: http://de.php.net/xml and > http://de.php.net/manual/en/ref.xml.php#xml.encoding > > From all I can tell for PHP, it represents strings in their > 'native' (byte) representation, so that if you have two XML > documents, one using 8859-1 and one UTF-8, you need to convert > between them to compare literal strings outside the ASCII range. > (http://de.php.net/manual/en/language.types.string.php) > > I don't see why restricting character sets to UTF-8 complicates > processing. > > Andrew Newton wrote: >> Usually they pass back the element content as a unicode compatible >> string or an array of unicode compatible characters, and the >> application does not need to make a distinction between UTF-8 and >> UTF-16. Some languages have native Unicode support, but in cases >> where that is not true special types are defined to represent xml >> character data. >> -andy >> On Jan 6, 2006, at 4:39 AM, Henning Schulzrinne wrote: >>> How do XML parsers pass back string elements to the application? >>> >>>> Unless you foresee the development of special purpose XML >>>> parsers for this application, I can see no advantage to ruling >>>> out UTF-16. As for your stated disadvantage, which XML parsers >>>> pass raw bytes to the application instead of a common format? >>>> Admittedly there are gobs of XML parsers out there, but I've >>>> never seen one that does this. >>>> -andy >>>