logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Unicode Logging questions
Date Tue, 01 Feb 2005 19:31:15 GMT

On Feb 1, 2005, at 4:44 AM, LECHNER Martin wrote:

> Thanks to your help I was finaly able to compile the log4cxxd.dll.
> I tried it out with logging of some unicode characters (japanese and 
> german)
> and have a few questions:
> Is there a way to get readable chars instead of the unicode (\u4ECA) 
> number
> of the character?

That is the intent behind the Unicode rework, but not everything is 
fleshed out.  The "\u4ECA" construct is generated by 
Transcoder::encode(const LogString& src, std::string& dst) when a 
character in src cannot be represented in the current code page.

In the case of the text file, you will get that form unless you specify 
an encoding that can represent the character (UTF-16 or UTF-8) using 
WriterAppender::setEncoding (or the equivalent configuration entry).  
However, support for arbitrary encodings hasn't been completed.  I 
expect to implement it using APR-iconv shortly.

I can probably fix the XML faster.  Even though you could encode those 
characters as UTF-8 (since all XML processors are required to support 
UTF-8), it is probably preferable to represent non-USASCII characters 
as character entities (for example, &x4ECA;) since it would not be 
uncommon for users to try to open up a log file in a non-XML aware text 
editor or use a command line tool like cat.

View raw message