public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Lukas Wagner <l.wagner@proxmox.com>
Subject: [pve-devel] [PATCH manager] api: apt: Return valid utf8 on update
Date: Thu, 25 Sep 2025 16:49:29 +0200	[thread overview]
Message-ID: <20250925144931.477293-1-m.sandoval@proxmox.com> (raw)

The following call could result in a broken encoding when a package
description contains unicode characters.

    pvesh get /nodes/localhost/apt/update

One potential example of such a package was libnbd0 where the character
'—' (em dash) was rendered as 'â'.

The file at /var/lib/pve-manager/pkgupdates would also have the wrong
encoding.

This patch fixes both issues.

Reported-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---

One unfortunate problem for reproducing this issue is that this particular
package is already on the latest version on the Proxmox VE 9.0 iso.

 PVE/API2/APT.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm
index 0d07cf38..27842aa6 100644
--- a/PVE/API2/APT.pm
+++ b/PVE/API2/APT.pm
@@ -107,7 +107,7 @@ my $assemble_pkginfo = sub {
     if (my $desc = $info->{LongDesc}) {
         $desc =~ s/^.*\n\s?//; # remove first line
         $desc =~ s/\n / /g;
-        $data->{Description} = $desc;
+        $data->{Description} = decode('UTF-8', $desc);
     }
 
     foreach my $k (qw(Section Arch Priority)) {
-- 
2.47.3



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

                 reply	other threads:[~2025-09-25 14:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250925144931.477293-1-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=l.wagner@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal