XmlLanguage.GetEquivalentCulture doesn't match System.Globalization.CultureInfo
See original GitHub issue- .NET Core Version: 5.0
- Windows version: windows 10
- Does the bug reproduce also in WPF for .NET Framework 4.8?: No
- Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc…)? No
Problem description: XmlLanguage.GetEquivalentCulture() no longer matches new System.Globalization.CultureInfo. When compiling with netcoreapp3.1 string1 and string2 in the code block below are the same. With net5.0 they are different.
var string1 = (-10).ToString("C2", new System.Globalization.CultureInfo("en-US"));
var string2 = (-10).ToString("C2", System.Windows.Markup.XmlLanguage.GetLanguage("en-US").GetEquivalentCulture());
Actual behavior: string1 and string2 difer
Expected behavior: string1 and string2 are the same
Minimal repro: See description
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top Results From Across the Web
.net - CultureInfo CurrentCulture does not correspond to ...
When I publish my application though it does not. As a test I added alert("@System.Globalization.CultureInfo.CurrentCulture.
Read more >Util Class (C1.Util) | ComponentOne OLAP for WPF and ...
Gets a System.Globalization.CultureInfo to match a given System.Windows.Markup.XmlLanguage. Public Method static (Shared in Visual Basic), GetFirstChildOfType ...
Read more >XmlLanguage.cs source code in C# .NET
The tag may or may not have a registered CultureInfo present on the system. /// This class is useful for dealing with values...
Read more >CultureInfo Class (System.Globalization)
Provides information about a specific culture (called a locale for unmanaged code development). The information includes the names for the culture, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here we go: https://learn.microsoft.com/en-us/dotnet/core/extensions/globalization-icu
should restore the .NET Framework behavior.
Here is a reop showing the issue: https://github.com/innominate227/WpfCurrencyNegativePatternIssue. And screenshot of what I see when debugging.