hi!

in my previous mails, i was struggling with meshes not being displayed correctly anymore. i had finally realized that this happened due to osg not being localisation safe. see this thread:

http://wxforum.shadonet.com/viewtopic.php?t=8079

even if this issue does not have to do anything with graphics, it can become quite an annoying problem, if someone (like me) wants to use osg in an application which supports localisation through c locales. the problem is that standard c functions like sprintf and scanf are also affected by the current locale (the decimal seperator is a dot in english but a comma in german, just as an example), but osg ignores this. example:

       else if (*ptr=='.')
       {
           if (hadDecimalPlace)
           {
               couldBeInt = false;
               couldBeFloat = false;
           }
           else
           {
               hadDecimalPlace = true;
               couldBeInt = false;
           }
       }

i can think of two solutions for this:

- we replace all calls to scanf, sprintf etc with stl alternatives, as these are not affected by localisation - or we simply check for the right characters - so instead of simply checking a a stream for '.', we get the decimal seperator from the current c locale. more info: http://www.chemie.fu-berlin.de/chemnet/use/info/libc/libc_19.html

thank you for your patience and please think about it!
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to