On 3/12/06, peter royal <[EMAIL PROTECTED]> wrote: > > On Mar 11, 2006, at 11:00 AM, [EMAIL PROTECTED] wrote: > > ** Applied Peter's patch to ByteBuffer after some optimization. > > I don't like this optimization.. seems premature.
Yep I noticed it by myself and fixed it again: http://svn.apache.org/viewcvs?rev=385102&view=rev Trustin The core of my concern is that the expectedLength is only based on > the average bytes per character, which for UTF-8 is only 1.1. The max > is 4, so its not that hard for the expected length to be way off if > you have many wide characters. I thought the max is 6. It seems like there's a wrong documentation: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 The official site claims that it takes up to four octets: http://www.utf-8.com/ Thanks, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6
