Description
"und" is the correct BCP-47 tag for the "undetermined language" and maps correctly to CultureInfo.InvariantCulture when using CultureInfo.GetCultureInfo("und").
"root" is the alternative moniker used by CLDR.
When using CultureInfo.GetCultureInfo("root") it does not throw a CultureNotFoundException.
Rather it returns an incomplete unknown culture with LCID 4096.
And if one attempts to read NumberFormat off of it:
> System.Globalization.CultureInfo.GetCultureInfo("root").NumberFormat
System.NullReferenceException: Object reference not set to an instance of an object.
+ System.Globalization.NumberFormatInfo.InitializeInvariantAndNegativeSignFlags()
+ System.Globalization.CultureInfo.get_NumberFormat()
Reproduction Steps
Open any C# repl and execute:
System.Globalization.CultureInfo.GetCultureInfo("root").NumberFormat
Expected behavior
Either CultureInfo.GetCultureInfo("root") throws a CultureNotFoundException or it produces an actual intact culture.
Actual behavior
CultureInfo.GetCultureInfo("root") is accepted as a valid, recognized culture and does not throw a CultureNotFoundException - however what it produces is in fact not an actual intact culture.
Regression?
No response
Known Workarounds
No response
Configuration
.NET version: .NET 10
OS: Windows 11
Other information
No response
Description
"und" is the correct BCP-47 tag for the "undetermined language" and maps correctly to
CultureInfo.InvariantCulturewhen usingCultureInfo.GetCultureInfo("und")."root" is the alternative moniker used by CLDR.
When using
CultureInfo.GetCultureInfo("root")it does not throw aCultureNotFoundException.Rather it returns an incomplete unknown culture with LCID 4096.
And if one attempts to read NumberFormat off of it:
Reproduction Steps
Open any C# repl and execute:
System.Globalization.CultureInfo.GetCultureInfo("root").NumberFormatExpected behavior
Either
CultureInfo.GetCultureInfo("root")throws aCultureNotFoundExceptionor it produces an actual intact culture.Actual behavior
CultureInfo.GetCultureInfo("root")is accepted as a valid, recognized culture and does not throw aCultureNotFoundException- however what it produces is in fact not an actual intact culture.Regression?
No response
Known Workarounds
No response
Configuration
.NET version: .NET 10
OS: Windows 11
Other information
No response