From 4b5db269ec8aae689329633a1ebe9546a19490b3 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Tue, 8 Apr 2025 10:47:43 +0200 Subject: [PATCH] country.pl: load iso 3166 country codes file as UTF8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file is UTF-8 encoded and contains Unicode characters for encoding country names, such as "Ă…land Islands" for example. Otherwise, the final locale-info.json that gets shipped with the ISO might contain wrongly-encoded country names, causing display errors in (at least) the GTK installer country dropdown. Reported-by: Maximiliano Sandoval Signed-off-by: Christoph Heiss Reviewed-by: Maximiliano Sandoval Tested-by: Maximiliano Sandoval Link: https://lore.proxmox.com/20250408084750.161399-1-c.heiss@proxmox.com --- country.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/country.pl b/country.pl index 9e4881a..7401f68 100755 --- a/country.pl +++ b/country.pl @@ -88,7 +88,7 @@ my sub parse_zoneinfo { # country codes from: my $country_codes_file = "/usr/share/iso-codes/json/iso_3166-1.json"; -my $iso_3166_codes = from_json(PVE::Tools::file_get_contents($country_codes_file, 64 * 1024)); +my $iso_3166_codes = from_json(PVE::Tools::file_get_contents($country_codes_file, 64 * 1024), { utf8 => 1 }); my $country_codes = { map { lc($_->{'alpha_2'}) => $_->{'common_name'} // $_->{'name'} } @{$iso_3166_codes->{'3166-1'}} };