Skip to content

Commit f03affd

Browse files
authored
Update Windows zone names using local database (#15837)
This points `ZONEINFO` to `spec/std/data/zoneinfo.zip` and uses the new version built in #15792, meaning the script now works consistently across all platforms and does not depend on any system definitions.
1 parent 600a7d9 commit f03affd

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

scripts/generate_windows_zone_names.cr

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ require "xml"
99
require "../src/compiler/crystal/formatter"
1010
require "ecr"
1111

12-
WINDOWS_ZONE_NAMES_SOURCE = "https://raw.githubusercontent.com/unicode-org/cldr/817409270794bb1538fe6b4aa3e9c79aff2c34d2/common/supplemental/windowsZones.xml"
12+
# CLDR-18479 Update CLDR data to TZDB 2025b. (#4593)
13+
WINDOWS_ZONE_NAMES_SOURCE = "https://raw.githubusercontent.com/unicode-org/cldr/f8369ba0795c79f3bac8eb89967eea359f77835e/common/supplemental/windowsZones.xml"
1314
TARGET_FILE = File.join(__DIR__, "..", "src", "crystal", "system", "win32", "zone_names.cr")
15+
ZONEINFO_ZIP = File.join(__DIR__, "..", "spec", "std", "data", "zoneinfo.zip")
1416

1517
response = HTTP::Client.get(WINDOWS_ZONE_NAMES_SOURCE)
1618
xml = XML.parse(response.body)
@@ -27,6 +29,7 @@ iana_to_windows_items = entries.map do |tzdata_name, territory, windows_name|
2729
{tzdata_name, windows_name}
2830
end.uniq!
2931

32+
ENV["ZONEINFO"] = ZONEINFO_ZIP
3033
windows_zone_names_items = entries.compact_map do |tzdata_name, territory, windows_name|
3134
next unless territory == "001"
3235
location = Time::Location.load(tzdata_name)

src/crystal/system/win32/zone_names.cr

Lines changed: 7 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)