-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
System.ComponentModel.TypeConverterTests.SizeFConverterTests failing for locale en-DE #25862
Comments
@Anipik not seen in Spanish os? |
No, the failure is not seen in Spanish. Even in Spanish the decimal separator is “,” |
I'd assume that the char sep = culture.TextInfo.ListSeparator[0];
string[] tokens = text.Split(sep); splitting the input text wrongly. So instead of two tokens containing |
@FreezyLemon you can test your theory by setting the culture = "en-US" just before this line https://github.com/dotnet/corefx/blob/73214ff6da537eb9dcf522406ef1d0470b88db88/src/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs#L55 |
The List separator for Spanish is ";" |
en-US passes the tests. It seems like my assumptions above were correct, even though this only applies to a few (?) locale choices EDIT: en-DK also fails, I misspelled it as "en-DA" before |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
This issue will now be closed since it had been marked |
The problem here seems to be that german numbers use the comma (
,
) as a decimal separator instead of a dot (.
):https://github.com/dotnet/corefx/blob/73214ff6da537eb9dcf522406ef1d0470b88db88/src/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs#L55-L62
text
is the input string to be converted.In
en-us
, the decimal point is represented by.
andListSeparator
is,
->
text == "3.402823E+38, 3.402823E+38"
In
de-de
(the "normal" german locale), the decimal point is,
andListSeparator
is;
->
text == "3,402823E+38; 3,402823E+38"
Since this locale mixes the two, unfortunately the two are the same:
text == "3,402823E+38, 3,402823E+38"
This seems to break the code since
tokens
is not splitting the numbers correctly here, leading to the exception.The text was updated successfully, but these errors were encountered: