Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ab91124

Browse files
authored
Fix timezone lookup to be consistently case insensitive (#15951)
The timezone ids used case insensitive comparisons everywhere, except in the dictionary used to cache timezones. Fixes dotnet/corefx#26479
1 parent af63885 commit ab91124

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mscorlib/shared/System/TimeZoneInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ private static TimeZoneInfoResult TryGetTimeZoneFromLocalMachine(string id, bool
18941894
if (result == TimeZoneInfoResult.Success)
18951895
{
18961896
if (cachedData._systemTimeZones == null)
1897-
cachedData._systemTimeZones = new Dictionary<string, TimeZoneInfo>();
1897+
cachedData._systemTimeZones = new Dictionary<string, TimeZoneInfo>(StringComparer.OrdinalIgnoreCase);
18981898

18991899
cachedData._systemTimeZones.Add(id, match);
19001900

0 commit comments

Comments
 (0)