[Scummvm-devel] How to deal with locale-related problems?
Willem Jan Palenstijn
wjp at usecode.org
Sun Oct 27 14:15:36 CET 2013
On Sun, Oct 27, 2013 at 11:56:20AM +0100, Torbjörn Andersson wrote:
> Hi,
>
> I was wondering how we should deal with locale-related problems. I
> noticed yesterday that Zork Nemesis fails pretty badly on my computer
> unless I mess with LC_NUMERIC, and that made me wonder if we have
> similar problems lurking in more stable parts of ScummVM.
>
> (I've filed a bug report about the problem in general. See #3615148.)
>
> Should we set the locale ScummVM uses explicitly (if so, we would have
> to consider the effects on our getSystemLanguage() function, and whether
> or not this can even be done for all supported platforms), or should we
> introduce our own locale-independent functions? (Which functions would
> that be anyway? I'm guessing sscanf(), sprintf(), atof() and any related
> functions. Indirectly, that would also take care of our own
> String::format() and String::vformat() as well.)
>
> Are there tools to help look for these kinds of problems?
Thanks for catching this!
For the specific case of WME saving I think I'd prefer not to use printf/sscan
at all, since they potentially introduce rounding errors in the binary/decimal
conversion too. This does of course sidestep the larger general issue.
-Willem Jan
More information about the Scummvm-devel
mailing list