W3C home > Mailing lists > Public > www-tag@w3.org > June 2005

Re: Requiring UTF-8 for XML (was: RE: google sitemaps and some history of sitemaps [siteData-36])

From: Elliotte Harold <elharo@metalab.unc.edu>
Date: Sun, 12 Jun 2005 08:21:50 -0400
Message-ID: <42AC28DE.8000400@metalab.unc.edu>
To: www-tag@w3.org

Another important feature of UTF-8 vs. UTF-16, irrespective of size 
issues. In UTF-8 you always know where you are. That is, given a single 
byte you can immediately determine if it is a single byte character, the 
first byte of a two-byte character, the second byte of a two-byte 
character, or the second or third or fourth byte of a three-or-four byte 
character. (That's not quite all the possibilities but you get the 
idea.) In UTF-16, you don't always know that the byte 0x41 is indeed the 
letter A. Sometimes it is and sometimes it isn't. You have to keep track 
of enough state to know where you are in the stream. If a single byte 
gets lost, all data from that point forward is corrupted, at least until 
another byte is lost.

Elliotte Rusty Harold  elharo@metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
Received on Sunday, 12 June 2005 12:21:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:56:09 UTC