Hi all,
I have some problems with ISO-5589-1 and UTF-8 encodings in XML documents.
Concretely, I have this ISO-8859-1 - encoded XML document:
Á
É
Í
Ó
Ú
Then I UTF-8 - encode it, by means of the following piece of code:
Transformer transformer =
TransformerF
Hi Inma,
The last line of your first block you have:
return baos.toString();
Note that when you do “toString()” on the byte array it will return a string in
Java internal form, not UTF8. I’m guessing that in your next block of code,
xmlutf8 is the result of the first block. This means that whe
Hi Inma,
xmlutf8.getBytes() doesn't return what you think. Both
ByteArrayOutputStream.toString() [1] and String.getBytes() [2] use the
default encoding (which is probably ISO-8859-1 on your system) for
converting between bytes -> chars and chars -> bytes. You can fix this by
specifying the enc