I've got the following problem in my app (using MS Windows XP, VS2005, CEGUI v0.5.0):
I have a file-path that contains some non-English characters, like:
Code: Select all
std::wstring logPath = L"C:\\Project\\MyApp\\Мои Данные\\CEGUILog.txt";
and I want to set it during the creation of System object as my log file.
Code: Select all
CEGUI::String sLog = { here I call some subroutine that converts UTF16 to UTF8 (via WideCharToMultiByte), then I assign it}
new CEGUI::System(m_impl->m_renderer, 0, 0, 0, "", sLog);
and get the exception from the DefaultLogger::setLogFilename(..):
"Logger::setLogFilename - Failed to open file."
First of all, I thought there is something wrong with UTF16 -> UTF8 conversion, but i tried this routine to write non-English text on some CEGUI controls (buttons, listbox listitems, etc) and it seems everything is fine.
However, then I noticed that the DefaultLogger::setLogFilename calls d_ostream.open(filename.c_str(), ....) routine that expects the file-path to be ANSI.
But the filename.c_str() method call returns the UTF8 characters and the method fails..
Now I'm stuck =(
I would be grateful if somebody helped me to fix this..
Thanks