Fix timezone lookup to be consistently case insensitive (#15951)
authorJan Kotas <jkotas@microsoft.com>
Sat, 20 Jan 2018 21:32:46 +0000 (13:32 -0800)
committerGitHub <noreply@github.com>
Sat, 20 Jan 2018 21:32:46 +0000 (13:32 -0800)
The timezone ids used case insensitive comparisons everywhere, except in the dictionary used to cache timezones.

Fixes dotnet/corefx#26479

src/mscorlib/shared/System/TimeZoneInfo.cs

index f9b5ce8..6e27376 100644 (file)
@@ -1894,7 +1894,7 @@ namespace System
             if (result == TimeZoneInfoResult.Success)
             {
                 if (cachedData._systemTimeZones == null)
-                    cachedData._systemTimeZones = new Dictionary<string, TimeZoneInfo>();
+                    cachedData._systemTimeZones = new Dictionary<string, TimeZoneInfo>(StringComparer.OrdinalIgnoreCase);
 
                 cachedData._systemTimeZones.Add(id, match);