-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the C locale for non-Windows CharArrayFromFormatV() and StringFromFormat() #2004
Conversation
Hmm, shouldn't we consistently use the C locale everywhere, for everything? User locale is always bound to make problems when inter-opping, or when assuming something/nothing about the values and their representation. |
The non-C locale is used (and setup) by the GUI toolkit (wxWidgets via wxLocale) in order to handle localisation. |
@dolphin-emu-bot rebuild The code looks good to me. |
|
…mFormat() The Windows implementations of CharArrayFromFormatV() and StringFromFormat() use the "C"/".1252" locale instead of the user locale (using _vsnprintf_l). On non-Windows, the user locale was used. This leads to bugs on non-Windows: the Overclock parameter was serialised with the user locale ("0,279322" in some locale) and was interpreted back as "0" (because the C locale is used for parsing the string). Make non-Windows CharArrayFromFormatV() and StringFromFormat() consistent with their Windows counterpart. The locale code is not enables for Android:: uselocale is only available since API 21 and API 21 only supports C and C.UTF-8.
@randomstuff IIRC uselocale() in the NDK doesn't do anything, as far as I know Android always assumes C locale. |
@dolphin-emu-bot rebuild |
Yes, recent version of bionic have locale management fucntions but they only support "C" vs "C.UTF-8" (the default). |
LGTM |
This bug is stil on master. Can this be merged or should another fix be used ? |
I'm for merging as it is. |
Use the C locale for non-Windows CharArrayFromFormatV() and StringFromFormat()
This was reverted ? I get problem with saving CPU Override in r6963 on Windows. |
@Tapcio: This specific patch does not change the behaviour on Windows. I think, it was supposed to have been fixed on Windows. |
It's not fixed on Windows. // sorry for bad english |
Can you please create an issue on our issue tracker, instead of posting on a closed PR? This would help us more in keeping track of issues that are still present. |
Hym, there already is: https://code.google.com/p/dolphin-emu/issues/detail?id=8095 |
The Windows implementations of
CharArrayFromFormatV()
andStringFromFormat()
use the"C"
/".1252"
locale instead of the user locale (using_vsnprintf_l
). On non-Windows, the user locale was used.This leads to bugs on non-Windows: the Overclock parameter was serialised with the user locale (
0,279322
in some locale) and was interpreted back as0
(because the"C"
locale is used for parsing the string).Make non-Windows
CharArrayFromFormatV()
andStringFromFormat()
consistent with their Windows counterpart.