I have a Windows 2019 server (set to en-US for all language settings) for which the following code:
var unsorted = new[] {"Aldi", "Al-Murad Tiles", "AliExpress" };
Console.WriteLine("Unsorted: " + string.Join(',', unsorted));
var sorted = unsorted.OrderBy(x => x);
Console.WriteLine("Sorted: " + string.Join(',', sorted));
Produces:
I have a Windows 11 machine (set to en-GB for all language settings) for which the same code produces:
It makes no difference if I set the culture of the current thread to be the same as the server:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
Does anyone know what settings should be applied to the current thread to make existing code sort the same on the Windows 11 machine as it does on the server?
(worth saying this is an example extracted from a much larger legacy codebase so I'd like to make minimal code changes to the affect the current thread/context/environment to make this sorting work rather than re-factor the existing code)

