failure to creat log file having unicode characters in its filepath
Logging Framework for C++
Brought to you by:
wilx
/Users/<someName>/私は食べに行くよ
./configure CXX="clang++ -arch i386 -stdlib=libstdc++" --with-working-locale
fileName
value recieved is /Users/<someName>/私は食べに行くよ/log.txt
void LogImpl::setFile(const std::wstring &fileName)
{
log4cplus::tstring ts;
ts.assign(fileName.begin(), fileName.end());
log4cplus::RollingFileAppender *rfa = new log4cplus::RollingFileAppender(ts,
DMLOG_MAXSIZE_PERFILE, DMLOG_MAXFILES_FORLOG);
//...
//...
//...
}
4 Unfrtunately, the log file does not get created.
5. When i try the same thing with the non-unicode path, it works fine.
Can you please help me understand what mistake is being done in the above steps.
What I noticed is log4cplus::tstring ts - this variable is failing to recognize unicode characters and replaces all unicode characters with alphanumerics as follows
log4cplus::tstring "/Users/<somename>/\xc1o\xdfykLO\x88/test.log"</somename>
Diff:
Diff:
Try without
--with-working-locale
configuration and try to use--with-working-c-locale
instead.I wonder if the above suggestion to use
--with-working-c-locale
has helped or not.