From: Václav Z. <vha...@gm...> - 2012-06-01 13:22:30
|
On 31 May 2012 19:21, Václav Zeman wrote: > On 05/31/2012 05:46 PM, vvv jjj wrote: >> Hi log4cplus Devel Team, >> >> Thanks Václav Zeman. >> >> I gave Unicode text directly in the cpp file. (Ex: CString str = >> _T("Ω⅓∂₤◊");) >> The file is saved with unicode support (the default yes button when >> Unicode file is saved in Visual Studio 2008). The configuration used >> is Debug Unicode dynamic library. >>[...] I have reproduced your problem on Windows as well. The problem is Windows problem with its code pages. Even though you are using the Debug_Unicode (or Release_Unicode) configuration, which means that the output stream is std::wfstream, the output file is always using chars (not wchar_ts). If you insist on logging characters outside of your Windows code page, then you are unfortunately (nearly) out of luck for 1.0.4.1. The best way to work around this for 1.0.4.1 would be to derive your own appender from *FileAppender that you use and either (1) override its append() member function to do, either wchar_t -> UTF-8 (or any other translation) on the fly, or, if you can use Visual Studio 2010, (2) imbue the underlying file stream with, e.g., std::codecvt_utf8<tchar, 0x10FFFF, static_cast<std::codecvt_mode>(std::consume_header | std::little_endian)> facet. For trunk and 1.1.x branches you can do (2) using imbue() member function on *FileAppender. -- VZ |