all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer] country.pl: load iso 3166 country codes file as UTF8
Date: Tue,  8 Apr 2025 10:47:43 +0200	[thread overview]
Message-ID: <20250408084750.161399-1-c.heiss@proxmox.com> (raw)

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 <m.sandoval@proxmox.com>
Signed-off-by: Christoph Heiss <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'}} };
 
-- 
2.48.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

             reply	other threads:[~2025-04-08  8:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08  8:47 Christoph Heiss [this message]
2025-04-08  8:48 ` Maximiliano Sandoval
2025-04-08  9:13 ` [pve-devel] Applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250408084750.161399-1-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal