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.

Reply via email to