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]

Reply via email to