I am having a problem sorting Swedish strings.
I am having problems with the following characters: v, w, å, ä, ö.
new[] { "ö", "ä", "å", "wa", "va", "wb", "vb", "a" }
.OrderBy(x => x, new CultureInfo("sv-SE").CompareInfo.GetStringComparer(CompareOptions.None))
Expected: a, va, vb, wa, wb, å, ä, ö
Actual: a, va, wa, vb, wb, å, ä, ö
Is the there any option to make it sort the strings as expected?
As a work-around I have switched to the culture se-SE (Sami) just for sorting alphabetic strings correctly while I wait for the .NET sorting rules to be updated.
Update:
Here is the github issue: https://github.com/dotnet/corefx/issues/37753
Update2:
The issue is not with .NET, it is the sorting rules defined in the underlying operating system. This error is only present on Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With