summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ellis <matell@microsoft.com>2016-01-06 14:51:44 -0800
committerMatt Ellis <matell@microsoft.com>2016-01-06 15:53:22 -0800
commitbfd12afe00c79471c00120173478f1e0c5838911 (patch)
tree089ab0bf1fb285616339061d7d1c7198ce909aee
parente8d94bca0185e621c20b2923f2536729eedebef9 (diff)
downloadcoreclr-bfd12afe00c79471c00120173478f1e0c5838911.tar.gz
coreclr-bfd12afe00c79471c00120173478f1e0c5838911.tar.bz2
coreclr-bfd12afe00c79471c00120173478f1e0c5838911.zip
Don't use Turkish casing for en-US-POSIX.
Previously, we were using a comparision between "i" and "I" (while ignoring case) to figure out if we needed to do Turkish casing (on the assumption that locales which compared i and I as non equal when ignoring case were doing Turkish casing). ICU Does tailoring of the en-US-POSIX locale and assigns different primary wights to 'i' and 'I'. You can see this in the ICU Collation Demo by looking at the raw collation elements. Different primary weights mean they different letters, not the same letter with a difference in casing (which is a trinary weight). This changes the check to compare using an actual Turkish i when doing our detection to not get confused by these cases. Fixes #2531
-rw-r--r--src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs b/src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs
index a60707cb60..84ecfeab17 100644
--- a/src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs
+++ b/src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs
@@ -88,7 +88,8 @@ namespace System.Globalization
private bool NeedsTurkishCasing(string localeName)
{
Contract.Assert(localeName != null);
- return CultureInfo.GetCultureInfo(localeName).CompareInfo.Compare("i", "I", CompareOptions.IgnoreCase) != 0;
+
+ return CultureInfo.GetCultureInfo(localeName).CompareInfo.Compare("\u0131", "I", CompareOptions.IgnoreCase) == 0;
}
private bool IsInvariant { get { return m_cultureName.Length == 0; } }