locale change in file open dialog

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
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

locale change in file open dialog

Post by pera »

I have IXMLWriter and I use it to store float attribute.
on my computer xml file stores value with point like this:
0.2
but on some other computers that have different OS settings, float is saved with comma:
0,2

Problem is that on those computers it won't load them back as floats. It doesnt recognize format.

Further more I would like all computers to store with point format (0.2) so that those xml files can be loadable on all computers.

Any idea how to force it to use point?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Set you locale to "C" when running the application. This uses the default. delimiter char.
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

ahh... thanks.

I searched irrlicht code for this, and i found one occurrence in irrlicht 1.6.1

CGUIFileOpenDialog::fillListBox()

that calls


#if !defined(_IRR_WINDOWS_CE_PLATFORM_)
setlocale(LC_ALL,"");
#endif

so i guess when I open file dialog it is changed from default "C" to local settings.... why is it really needed there? Maybe it is changed in newer versions?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I have absolutely no clue why it is called there. This will also have strange effects on Irrlicht's internal behavior, and also those of the applications using Irrlicht. I'll move this topic to the bug forum, even though the OT was different, will also change the title for better visibility. I guess you have your answer then ;-)
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

thanks.
Post Reply