logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <josef.stadelm...@axa-winterthur.ch>
Subject AW: Encoding problem
Date Mon, 03 Jan 2011 15:33:33 GMT
Can you try

log4j.appender.monappender.Encoding="ISO-8859-1"

in this case your logger output should be a single byte for a é but not 2 as with UTF-8



But I guess that is not your problem. Also you are not telling me with which program your
logfile is shown to the user. 


If your characters are encoded in UTF-8 then any accented character like é is represented
by a 2 bytes sequence

So it might happen that your logfile is encoded in UTF-8, hence é is actually 2 bytes stored
in a logfile!

Now opening the log file with microsoft word, and telling word (interactively) that the file
has an UTF-8 encoding should make word display the proper é but not 2 characters.

If you encode as ISO-8854-1 (as shown above) you need to tell word that the log-file-encoding
was done using ISO-8854-1, and word will display é

Josef



-----Ursprüngliche Nachricht-----
Von: valerie.bauche@bull.net [mailto:valerie.bauche@bull.net] 
Gesendet: Montag, 3. Januar 2011 15:29
An: log4j-user@logging.apache.org
Betreff: Encoding problem

Hello

I need to print logs containing accentuated characters with a FileAppender.
I set the encoding property :
log4j.appender.monappender.Encoding=UTF-8

But I still have problems with accents in the resulting log : é instead 
of é
Is this "Encoding" property working ?


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message