FileOpenDialog is garbled to display Multibyte code in 1.6

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
MadHyde
Posts: 34
Joined: Thu Sep 28, 2006 9:46 pm
Location: Japan
Contact:

FileOpenDialog is garbled to display Multibyte code in 1.6

Post by MadHyde »

Enviroment
Irrlicht 1.6 with FreeType2 (ANSI base)
Vista Japanese edition (shift-jis enviroment)

Issue
From Version 1.6, Multibyte strings are displayed in FileOpenDialog by #2450094 patch. thanks bitplane. But strings are garbled. Because two functions affect in CFileList.cpp and CFileSystem.cpp. This flow worked fine until 1.5.

Image

Code: Select all

CFileList.cpp
u32 CFileList::addItem(const io::path& fullPath, u32 size, bool isDirectory, u32 id)
{
	//...
	entry.Name.replace('\\', '/');
	//...
	if (IgnoreCase)
		entry.Name.make_lower();

Code: Select all

CFileSystem.cpp
io::path& CFileSystem::flattenFilename(io::path& directory, const io::path& root) const
{
	directory.replace('\\', '/');
	//...
IFileList* CFileSystem::createFileList()
{
	//...
	Path.replace('\\', '/');
One is make_lower(). It has forcedly converted the same value as the alphabet in the Japanese character set. so 開発(kaihatu - development) changes into 核発(kakuhatu - nuclear dev!?). See following character set comparison.

Image

And two is replace('\\', '/'). It has same issue above one. The file named コンソール(console) split into two parts on the way.

Image Image

there is bug test patch for Ver.1.6. (need FreeType2 & Multibyte font). This issue also happens at Bitmap Font.

bug test patch

Improvement
For internationalization, I think that this is the time to switch system to Unicode from ANSI. This problem can't be fundamentally solved in the ANSI environment.
I tried to compile Irrlicht with VC2008's Unicode swich and _IRR_WCHAR_FILESYSTEM flag. There is Unicode patch fixed compilation errors (not clean up). It's work fine :)

Irrlicht 1.6 Unicode with Freetype

Image

Don't you switch to unicode base?
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

YES!!! Unicode all the way, for greater compat. Thank you so much to keep pushing for greater multilingual support, much appreciated ^^
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Thanks. This Irrlicht version is definitely on my radar, I just haven't found the time so far to look into it. I hope that I or someone else in the team will find time soon to add truetype support to Irrlicht.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, I started to merge some of the fixes for the Unicode things. We will try to keep the things as flexible as possible. Windows stuff can use the _T() macro, which automatically changes between wchar_t and char depending on the MSVC setting. Will have to check this under mingw, though.
The changes which will also affect Linux and other platforms will be harder to fix properly. Might take some time - it's just not max priority. Thanks for all the work, I hope we can give it justice.
MadHyde
Posts: 34
Joined: Thu Sep 28, 2006 9:46 pm
Location: Japan
Contact:

Post by MadHyde »

Oh, I forgot _T() macro. Thanks hybrid. I hope that i18n is furthered on all platforms.
CuteAlien, I'll add FreeType class your version in next irrML. This test is also used one. Thank you for your maintenance.
Post Reply