[pve-devel] [PATCH manager] api: apt: Return valid utf8 on update

Maximiliano Sandoval m.sandoval at proxmox.com
Thu Sep 25 16:49:29 CEST 2025


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 at proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval at 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





More information about the pve-devel mailing list