Search Issue Tracker
[Mobile] System.Convert.ToSingle throws exception when using specific language on device
How to reproduce:
1. Download the attached project "Unity-ex.zip"
2. Set your mobile device language to Russian, French, Portuguese, or Polish
3. Build and Run on Android
4. Observe logs in Android logcat
Expected result: No exceptions are thrown and value "0.13" is converted to "13" or "0.13"
Actual result: Values are not converted and exception is printed:
Exception System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <255dd91c7bc04664a19c23cae337b20d>:0
at System.Number.ParseSingle (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00071] in <255dd91c7bc04664a19c23cae337b20d>:0
Reproducible with: 2020.1.0a5, 2020.3.26f1, 2021.2.8f1, 2022.1.0b3, 2022.2.0a2
Not reproducible with: 2019.4.34f1, 2020.1.0a4
- Not reproducible on Standalone builds or Editor
- Reproducible on Android and iOS
- Reproducible with .NET Framework and .NET Standard 2.1 Api Compatibility Level
- Reproducible with these languages: Russian, French, Portuguese, Polish (might be more affected languages)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- "Unexpected exception System.DllNotFoundException" error thrown in the Console window when creating a project with 2D (URP) Template
- [Backport] [XR SDK] [HDRP] XRSettings.gameViewRenderMode does not change Game View Render Mode
- [Backport] [Android][Vulkan] Crash on Samsung Note8 while running gfx tests
- [Backport] Wrong sorting for "GC Alloc" column in Show Related Objects panel of Profiler Window
- [Backport] [iOS] Unfreed allocation errors thrown in Console when executing Build And Run with iOS platform