Log the output to a file.....  then open the file in an editor supporting UTF-8
chars e.g. IE browser.
Your console doesn't support UTF-8 characters, hence you see "????".

log4jv1.2  is beta now.  beta 5 I believe.  Not alpha.


----- Original Message -----
From: "Oleg A. Paraschenko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 25, 2002 6:37 AM
Subject: support of file.encoding system property


>   Hello!
>
>   I'm using jakarta-log4j-1.1.3 and I wish to write logs in unicode. I'm
setting java system property 'file.encoding' to 'UTF8', but I get '????" instead
of UTF8 on output. Please revise my code, maybe I am doing something wrong.
>   I looked at archives, but did not understand if 1.1.3 supports this
property. I don't like to use alpha of 1.2.
>   It seems also that someone already implemented log writer with file.encoding
property. Is it possible to share implementation?
>
>   Thank you in advace.
>
> $ java -version
> java version "1.3.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
> Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20020124 (JIT enabled:
jitc))
> $ cat test.java
> import org.apache.log4j.Category;
> import org.apache.log4j.BasicConfigurator;
>
> public class test {
>   static Category logger = Category.getInstance(test.class);
>   static void main (String[] args) throws Throwable {
>     String str = new String("\u65e5\u672c\u8a9e\u6587\u5b57\u5217");
>     BasicConfigurator.configure();
>     logger.debug(str);
>   }
> }
> $ javac test.java
> $ java -Dfile.encoding=UTF8 test
> 0 [main] DEBUG test  - ??????
> $
>
>   Bye!
>
> --
> Oleg
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>


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

Reply via email to