Re: Strange UTF-8 in Java

From: Elliotte Rusty Harold (elharo@sunsite.unc.edu)
Date: Thu Oct 01 1998 - 11:07:15 EDT


>Rick McGowan scripsit:
>
>> I'd ask, why are these methods, which apparently produce or consume
>> non-conforming UTF-8, part of some publicly accessible API?
>
>Because they are public methods for serializing Java String
>objects to and from byte streams. They produce a documented
>format, 4-byte big-endian length followed by modified UTF-8 content.
>The format is documented so that non-Java programs can consume or
>produce such byte streams. The names of the methods are
>regrettable, indeed erroneous.
>

Actually the length is a two byte, big endian, unsigned integer; not a four
byte integer.

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@sunsite.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML: Extensible Markup Language (IDG Books 1998) |
| http://www.amazon.com/exec/obidos/ISBN=0764531999/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java news: http://sunsite.unc.edu/javafaq/ |
| Read Cafe con Leche for XML news: http://sunsite.unc.edu/xml/ |
+----------------------------------+---------------------------------+



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:42 EDT