cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject [d'oh!] java APIs are not powerful enough to handle the XML spec!!
Date Thu, 13 Nov 2003 18:06:35 GMT
The day somebody asks you why java needs to be replaced, one answer 
will be 'it only supports 16-bits chars'. laughable as it might seem, 
it's true.

yes, people, a Unicode char is not 16 bit (as I always though!) but 32!!

And even the XML specification says so.

Char ::=  #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | 
[#x10000-#x10FFFF]

do the math and you find that #x10000 cannot fit in 16 bits!

now, if you thought you could take the character() SAX event and create 
a String out of it and do something useful with is (like print it, for 
example), forget it. The result will very likely not be the one you 
expect.

Another reason not to use Stings at all.

--
Stefano.
Mime
View raw message