Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
0.10.0
-
None
-
None
-
Windows 7 64 bit, log4cxx built with VS2005
Description
Under region and language in the control panel, everything is set to English (United States) The user name has Chinese characters which are interpreted correctly in Windows Explorer and in my Unicode MFC application.
When using environment variables for the filename (not the path) I get a file output but the characters of the file name are garbled (from some other language).
If I execute the following code snippet, it interprets the environment variable correctly and the file is output with the correct path and file name.
wchar_t lPathPtr[2048];
size_t lPathSize = 0;
_wgetenv_s( &lPathSize, lPathPtr, 2048, L"APPDATA" );
if ( lPathPtr != NULL )
However if I create a configuration file that looks like this...
log4j.rootLogger=info, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${TESTENV}
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%r %p %t %c - %m%n
...and open that configuration file with a code snippet that looks like this...
LoggerPtr logger(Logger::getLogger("MyApp"));
PropertyConfigurator::configure("test.logcfg");
LOG4CXX_INFO(logger, "Entering application.");
... the file name ends up being garbled with funny characters.
Obviously if I replace ${TESTENV} with ${APPDATA}/unicode_test.txt, I don't see any output because the garbled folder path doesn't exist. This seems to be the case for European characters outside of the ascii range as well (like the german umlaut or the accent aigu in French).
Attachments
Issue Links
- duplicates
-
LOGCXX-370 There are Mistakes in Property Value which Contains Environment Variables, which Values Contain multibyte characters
- Resolved