[prev in list] [next in list] [prev in thread] [next in thread]
List: xml-cocoon-users
Subject: Re[2]: Cocoon, JX Temaplte and UTF-8
From: Martin Heiden <martin.heiden () netcologne ! de>
Date: 2008-02-28 19:50:22
Message-ID: 1019190819.20080228205022 () netcologne ! de
[Download RAW message or body]
Magnus,
I'd also suggest to write the output of m.write() to a file, to
inspect, if this outputs UTF-8 or ISO-8859-1. If it is UTF-8 add
the charset to bout.toString().
If you only deal with UTF-8, you should make sure that the
default-charset of the application server und cocoons settings are
utf-8 too.
(http://cocoon.apache.org/2.2/1366_1_1.html)
The difference between windows and linux, you noticed, is caused by
the different default encodings. (Windows cp1252, Linux UTF-8?)
The bout.toString("UTF-8") only ensures that the constructed string
honors the encoding of the ByteArrayOutputStream. This has nothing
to do with the output, it just ensures that the ByteArray is
converted properly to a Java string.
If you have a correct string, JX Template shouldn't mess around
with the charset. Try to debug your apple-class and take a look at
the string, before it is added to bizData.
Wait! This could be another problem...
Take a closer look at the ByteArray. It may be that you receive an
UTF-8 encoded File with BOM. Java can't deal with that. You would
have to cut all characters from the string that precede the first
"<", before adding the string to bizData. That would explain the
exceptions you received, but that wouldn't work on linux either.
Good luck!
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic