I need this to set the default StringComparison to StringComparison.InvariantCultureIgnoreCase
.
When searching a DataTable 'ss' and 'ß' are handled as they would be the same. I don't want this behavior; I need an ordinal comparison.
DataTable table = new DataTable();
table.Locale = new CultureInfo(1031); // LCID 1031 is the default in my country (germany)
table.Columns.Add("text");
table.Rows.Add("ss");
table.Rows.Add("ß");
int rowcount = table.Select("text = 'ss'").Length; // returns: 2
Assert.AreEqual(1, rowcount); // exception
table.DefaultView.Sort = "text";
rowcount = table.DefaultView.FindRows("ß").Length; // returns: 2
Assert.AreEqual(1, rowcount); // exception
Or is there maybe a default Culture which is using OrdinalIgnoreCase? I tried LCID 7 which is the neutral german culture but this still doesn't work.
Edit 1: I guess there is no culture definied where 'ss' is not equal 'ß':
int count = CultureInfo.GetCultures(CultureTypes.AllCultures)
.Where((item) => item.CompareInfo.Compare("ss", "ß") != 0)
.Count(); // count = 0