---- Description of the issue ----
I have troubles with Ogre and pathes containing non-ASCII characters.
If pathes contains non-ASCII characters, Ogre simply cannot open them.
For example, Trying to open this file t0无 implies this exception:
Code: Select all
12:50:57: Added resource location '/home/fabien/Desktop/t0?/worlds/textures' of type 'FileSystem' to resource group 'Volatile'
12:50:57: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource tagged_wall.png in resource group Volatile or any other group. in ResourceGroupManager::openResource at /home/fabien/software/ogre/OgreMain/src/OgreResourceGroupManager.cpp (line 756)
QString path = ... // valid path containing non ASCII characters
std::string utf8data(path.toUtf8().constData()); // should the string coded in UTF8
These issues occurs only on Windows (compiled with MinGW gcc tool chain), but not on my Mac and Linux environments.
--- Reason of the issue ---
The standard C++ functions to open files (for example std::ifstream::open(const char *filename, ...)) doesn't support unicode (on windows at least).
Of course, wide characters can be used, but
std::ifstream::open(const wchar_t *filename, ...)
is only defined when using the VS compiler, but not the MinGW gcc compiler
Moreover it's globally not a good idea to use wide characters in C++ (ref. http://utf8everywhere.org )
--- My point of view ---
UTF8 should be supported by Ogre for obvious reasons.
Ogre should not use standard C++ functions to deal with pathes. As there is already a dependency on Boost, I'd say that using boost::filesystem to manage pathes would be much better.
The switch between std::string and std::wstring seems not useful to me.
--- Related posts ---
http://www.ogre3d.org/forums/viewtopic.php?f=3&t=48424
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=47586
Could you tell me your point of view on this topic?
Sincerly
PsyCowboy
