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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
