Hmm, any chance you could upload an example XML file attached to the bug report Curt raised? Then we can have a crack at replicating it and trying a fix.

On 31/10/2007, at 8:17 AM, Jessica Lin wrote:

Since I am using Windows, I edited chainsaw.bat file as:
java - Dorg .apache .commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger - Dfile.encoding=UTF-8 -classpath jakarta- oro-2.0.6.jar;jmdns.jar;log4j-1.3alpha-7.jar;log4j- chainsaw-2.0alpha-1.jar;log4j-optional-1.3alpha-7.jar;log4j- oro-1.3alpha-7.jar;log4j-smtp-1.3alpha-7.jar;log4j- xml-1.3alpha-7.jar;log4j-zeroconf.jar;xstream-1.1.2.jar org.apache.log4j.chainsaw.LogUI


But the trick doesn't work.



Thanks,
Jessica


-----Original Message-----
From: Curt Arnold [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 30, 2007 1:24 PM
To: Log4J Users List
Subject: Re: Chainsaw display UTF-8 encoding problem


On Oct 30, 2007, at 2:16 PM, Jessica Lin wrote:

I want to use Chainsaw to view the log file contains Chinese
character. The log file was recorded by using FileAppender which I
defined the endoding as “UTF-8”. Here is part of my
log4j.properties file.



# xml format file appender

log4j.appender.xml=org.apache.log4j.FileAppender

log4j.appender.xml.file=xml.log

log4j.appender.xml.encoding=UTF-8

log4j.appender.xml.append=false

log4j.appender.xml.layout=org.apache.log4j.xml.XMLLayout



Then  I use Chainsaw to load “xml.log” file. The Chinese
characters are shown as “ åŠ è¿™ä¸ªåŠŸèƒ½”. The
Original characters are “加这个功能”.



I double checked the “xml.log” which did save as UTF-8 encoding.
The XMLDecoder file Which Chainsaw uses to load XML file also use
UTF-8 encoding.





Can you help me?





Thanks,

Jessica



Looks like Chainsaw (actually the receivers companion that Chainsaw
uses) is broken in how it loads XML documents and loads the document
using the current default encoding for the JVM.  I filed a bug
(http://issues.apache.org/bugzilla/show_bug.cgi?id=43736) with more
discussion.  Until that gets fixed, a workaround would be to change
the default encoding for the JVM when loading Chainsaw.  How to do
that appears to implementation specific.  If you are running on Linux
or similar, you could set LC_CTYPE=UTF-8 before launching Chainsaw,
on Windows adding a -Dfile.encoding=UTF-8 to the line launching
Chainsaw might do the trick.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Paul Smith
Core Engineering Manager

Aconex
The easy way to save time and money on your project

696 Bourke Street, Melbourne,
VIC 3000, Australia
Tel: +61 3 9240 0200  Fax: +61 3 9240 0299
Email: [EMAIL PROTECTED]  www.aconex.com

This email and any attachments are intended solely for the addressee. The contents may be privileged, confidential and/or subject to copyright or other applicable law. No confidentiality or privilege is lost by an erroneous transmission. If you have received this e-mail in error, please let us know by reply e-mail and delete or destroy this mail and all copies. If you are not the intended recipient of this message you must not disseminate, copy or take any action in reliance on it. The sender takes no responsibility for the effect of this message upon the recipient's computer system.



Reply via email to