logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Brand" <s-br...@hitachi-software.co.uk>
Subject RE: Double byte character support
Date Thu, 14 Feb 2008 17:25:54 GMT
I am running on linux and windows but I'm primarily debugging on Windows so
that's the platform I've seen this issue on. My encoding is English United
kingdom (with may of the codepage conversion table options clicked.

I send my log file content using wstring too e.g logTrace(wstring) and I've
not been having problems.

Its puzzling! To say the least.

-----Original Message-----
From: Curt Arnold [mailto:carnold@apache.org] 
Sent: 14 February 2008 17:15
To: Log4CXX User
Subject: Re: Double byte character support


On Feb 14, 2008, at 10:04 AM, Steve Brand wrote:

> Hi,
>
> I am using log4cxx with wchar_t* strings as the filename for my  
> fileappender, however when passing wchar_t* or std::wstring to the  
> LOG4CXX_DECODE_WCHAR macro it simply converts the double byte  
> characters in the string to ?? symbols. And the file appender does  
> not create correctly.
>
> Has anyone got experience with this or does log4cxx not support  
> double byte characters for filenames at the moment?
>
> Thanks
>
> Steve Brand


I've been meaning to add at least one test around that since it  
appears to be a good intention that hasn't been checked.  The APR docs  
aren't very clear what encoding they expect the file name to be in.

The behavior could very well be platform specific.  What platform are  
you running on and what is you current code page or encoding (type  
locale on Unix or Control Panel/Regional Settings on Windows)?

Are you getting the expected content in your log files?  There are  
unit tests around wide character log file content in the unit tests,  
so if your content is also messed up, that would suggest that  
log4cxx's CharsetEncoder and CharsetDecoder doesn't properly adjust to  
your platform.  If those are good, then it is something specific to  
File and its interaction with APR.



Mime
View raw message