J
Jean-Marc Autexier
Hi,
I must write UTF-16 files, with byte order mark (BOM) in little endian (jdk
1.4.2).
According to java.nio.charset, UTF-16LE and UTF-16BE don't use BOM, UTF-16
does (as defined in Unicode and XML standards).
UTF-16 can read big and little endian, but can only write big endian (see
below). Why?
regards
Jean-marc
From http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html
- When decoding, the UTF-16BE and UTF-16LE charsets ignore byte-order marks;
- when encoding, they do not write byte-order marks.
- When decoding, the UTF-16 charset interprets a byte-order mark to indicate
the byte order of the stream but defaults to big-endian if there is no
byte-order mark; when encoding, it uses big-endian byte order and writes a
big-endian byte-order mark.
I must write UTF-16 files, with byte order mark (BOM) in little endian (jdk
1.4.2).
According to java.nio.charset, UTF-16LE and UTF-16BE don't use BOM, UTF-16
does (as defined in Unicode and XML standards).
UTF-16 can read big and little endian, but can only write big endian (see
below). Why?
regards
Jean-marc
From http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html
- When decoding, the UTF-16BE and UTF-16LE charsets ignore byte-order marks;
- when encoding, they do not write byte-order marks.
- When decoding, the UTF-16 charset interprets a byte-order mark to indicate
the byte order of the stream but defaults to big-endian if there is no
byte-order mark; when encoding, it uses big-endian byte order and writes a
big-endian byte-order mark.