UnityLitJson icon indicating copy to clipboard operation
UnityLitJson copied to clipboard

Parsing Doubles fails if current CultureInfo is using a different decimal separator.

Open fixed opened this issue 10 years ago • 1 comments

I tried to parse a JSON in the Unity editor on Mac OS X, and it seems that the current CultureInfo is using a different decimal separator on my system. Hence, it fails to parse floating point numbers. The solution is to parse doubles with the invariant NumberFormatInfo, like it was written in JSONWriter.

fixed avatar Jun 18 '15 14:06 fixed

I spent half a day looking for why my game doesn't work correctly on some devices. Turn out it breaks on phone using a localization different from English. And I made the same fix as yours.

jacattrongnlh avatar Jan 18 '22 05:01 jacattrongnlh