Allow Unicode Paths

What it says on the tin: a place to discuss proposed new features.
Post Reply
RandomCitizen
Kobold
Posts: 26
Joined: Sat Jun 08, 2013 3:12 pm

Allow Unicode Paths

Post by RandomCitizen » Fri Sep 06, 2013 11:10 am

Ok Guys, Unicode Support is an issue popping up again again in the Ogre Forums. I think there should be something done :).

I agree, that Ogre is not an GUI Library and neither the Ogre itself nor the GUI used in the samples need to support Unicode

As Ogre is using Ogre::String to identify objects and so, I even think that Ogre::String should not support Unicode (I think that's the reason, while it's not supporting Unicode until now). I would even go a step further and suggest to remove the optional wchar_t version of Ogre::String, especially as it isn't compilable because of the Literal incompatibility (see http://www.ogre3d.org/forums/viewtopic.php?f=2&t=47586)

But what I think we need is a support of Unicode Paths as currently, some sort of platform dependent workarounds are needed: http://www.ogre3d.org/forums/viewtopic.php?f=2&t=76191

Se we see it is possible to handle unicode path, but not in an very object oriented way

My suggestion is to implement some kind of FilePath class (something like the path class from Boost filesystem, or maybe even simply using boost::filesystem::path).

This FilePath could be used everywhere were paths are handled inside of Ogre. For example when loading a plugin or resource using some kind Manager accessing the hard drive, you would give Ogre an instance of Ogre::FilePath without event thinking, whether the Operating system is supporting Utf8 or so.

Internally, when calling a Windows API code, Ogre::Path::getAsUtf16() would be called, while when using Unix api code Ogre::FilePath::getAsUtf8(). The user of Ogre wouldn't even need to know, that soething like Utf8 or utf16 even exist ;)
0 x

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
Contact:

Re: Allow Unicode Paths

Post by Klaim » Fri Sep 06, 2013 12:05 pm

There is a Google Summer OF Code project in progress that will make resource manager a separate component that is optional, allowing you to use whatever code you want to provide data to Ogre.
That way, you can easily implement a resource manager which is global to your application, not only managing Ogre data, and have whatever feature you need like Unicode file paths (maybe using boost::filesystem or std::filesystem in coming months )

Ther GSOC project thread: http://www.ogre3d.org/forums/viewtopic.php?f=13&t=77193

That should totally solve it, and tons of other problems.
0 x

RandomCitizen
Kobold
Posts: 26
Joined: Sat Jun 08, 2013 3:12 pm

Re: Allow Unicode Paths

Post by RandomCitizen » Fri Sep 06, 2013 12:30 pm

Sounds great! :D
0 x

Post Reply