Bug#950334: [Aptitude-devel] Bug#950334: aptitude: Help -> User's Manual contains special characters
Hi Diego, Diego Escalante wrote: > This is actually a broader bug and not related to specific locales. Suspected that, yes. But then again, not in the way you noticed. (I suspected ISO-Latin encoded chacracters in source code files, e.g. French or German contributor names, not hardcoded encoding names…) > The issue is that `src/ui.cc` defaults to transcoding the README files > to ISO-8859-1, and since all the README files are already UTF-8, you get > glitchy glyphs. I guess I wasn't aware of that when coverting them after Lintian warnings or so. At least I did that for many of my packages. Not sure if I was the one who did it with aptitude, but chances are not that low. ;-) > I'm attaching a patch for this specific issue, but note that I have an > open MR which includes this and a few more encoding related fixes: > https://salsa.debian.org/apt-team/aptitude/-/merge_requests/10/commits Thanks a lot! Funnily https://salsa.debian.org/apt-team/aptitude/-/merge_requests/10/diffs doesn't really show the changes as it at least partially seems to convert the encoding line by line. So both, old and especially new look good. :-) > Note also that I wasn't able to properly test this because of the > current FTBFS in: > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966875 Ack. Yeah, I'm aware of it. Building with gcc 9 instead of 10 should work, in case you're curious to see if it flies. :-) > But that said, this is merely a string replacement, shouldn't be > problematic. Ack, I think so, too. I though think we should not merge it before that FTBFS is fixed. Regards, Axel -- ,''`. | Axel Beckert , https://people.debian.org/~abe/ : :' : | Debian Developer, ftp.ch.debian.org Admin `. `' | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5 `-| 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
Bug#950334: aptitude: Help -> User's Manual contains special characters
Package: aptitude Version: 0.8.13-1+b1 Followup-For: Bug #950334 X-Debbugs-Cc: die...@gnome.org This is actually a broader bug and not related to specific locales. The issue is that `src/ui.cc` defaults to transcoding the README files to ISO-8859-1, and since all the README files are already UTF-8, you get glitchy glyphs. I'm attaching a patch for this specific issue, but note that I have an open MR which includes this and a few more encoding related fixes: https://salsa.debian.org/apt-team/aptitude/-/merge_requests/10/commits Note also that I wasn't able to properly test this because of the current FTBFS in: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966875 But that said, this is merely a string replacement, shouldn't be problematic. -- Package-specific info: Terminal: xterm-256color $DISPLAY is set. which aptitude: /usr/bin/aptitude aptitude version information: aptitude 0.8.13 Compiler: g++ 9.3.0 Compiled against: apt version 6.0.0 NCurses version 6.2 libsigc++ version: 2.10.2 Gtk+ support disabled. Qt support disabled. Current library versions: NCurses version: ncurses 6.2.20200212 cwidget version: 0.5.18 Apt version: 6.0.0 aptitude linkage: linux-vdso.so.1 (0x7ffcc57a8000) libapt-pkg.so.6.0 => /lib/x86_64-linux-gnu/libapt-pkg.so.6.0 (0x7fbc70029000) libncursesw.so.6 => /lib/x86_64-linux-gnu/libncursesw.so.6 (0x7fbc6ffee000) libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x7fbc6ffbf000) libsigc-2.0.so.0 => /lib/x86_64-linux-gnu/libsigc-2.0.so.0 (0x7fbc6ffb6000) libcwidget.so.4 => /lib/x86_64-linux-gnu/libcwidget.so.4 (0x7fbc6feb) libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x7fbc6fd84000) libboost_iostreams.so.1.71.0 => /lib/x86_64-linux-gnu/libboost_iostreams.so.1.71.0 (0x7fbc6fd5b000) libxapian.so.30 => /lib/x86_64-linux-gnu/libxapian.so.30 (0x7fbc6fb41000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x7fbc6fb1f000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x7fbc6f952000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x7fbc6f80e000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x7fbc6f7f4000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7fbc6f62d000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x7fbc6f613000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x7fbc6f5f6000) libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x7fbc6f5e3000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x7fbc6f5ba000) liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x7fbc6f598000) libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x7fbc6f4ec000) libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x7fbc6f4c6000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x7fbc6f41b000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x7fbc6f2fe000) /lib64/ld-linux-x86-64.so.2 (0x7fbc70684000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7fbc6f2f8000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x7fbc6f2eb000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x7fbc6f2e2000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x7fbc6f2bf000) -- System Information: Debian Release: bullseye/sid APT prefers unstable-debug APT policy: (500, 'unstable-debug'), (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 5.7.0-2-amd64 (SMP w/4 CPU threads) Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages aptitude depends on: ii aptitude-common 0.8.13-1 ii libapt-pkg6.0 2.1.7 ii libboost-iostreams1.71.0 1.71.0-6+b2 ii libc6 2.31-2 ii libcwidget4 0.5.18-5 ii libgcc-s1 10.2.0-3 ii libncursesw6 6.2-1 ii libsigc++-2.0-0v5 2.10.2-1 ii libsqlite3-0 3.32.3-1 ii libstdc++610.2.0-3 ii libtinfo6 6.2-1 ii libxapian30 1.4.15-1 Versions of packages aptitude recommends: ii libdpkg-perl1.20.5 ii sensible-utils 0.0.12+nmu1 Versions of packages aptitude suggests: pn apt-xapian-index pn aptitude-doc-en | aptitude-doc pn debtags ii tasksel 3.59 -- no debconf information >From 0cb1886fbbb0d6339bbd9458bc185b6d82d611af Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Mon, 3 Aug 2020 17:29:17 -0500 Subject: [PATCH] ui: Default README encoding to UTF-8 The ui uses a hint string to
Bug#950334: aptitude: Help -> User's Manual contains special characters
Package: aptitude Version: 0.8.12-1 Severity: minor Tags: l10n Hi, aptitude displays unwanted special characters in the user's manual view in a German environment (I didn't test if the same happens with different locales). To reproduce, I use the following locale environment: fuddl@wurst:~$ locale LANG=de_DE.UTF-8 LANGUAGE= LC_CTYPE="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_COLLATE="de_DE.UTF-8" LC_MONETARY="de_DE.UTF-8" LC_MESSAGES="de_DE.UTF-8" LC_PAPER="de_DE.UTF-8" LC_NAME="de_DE.UTF-8" LC_ADDRESS="de_DE.UTF-8" LC_TELEPHONE="de_DE.UTF-8" LC_MEASUREMENT="de_DE.UTF-8" LC_IDENTIFICATION="de_DE.UTF-8" LC_ALL= Start aptitude in an 80×24 characters terminal, select Hilfe (Help) -> Handbuch (User's Manual) and press page down once. You should see an output as in the left terminal window in the attached screenshot. The terminal on the right of the screenshot is for reference and shows aptitude with environment LANG=C. With that environment, aptitude displays the user's manual correctly. The special characters make the manual difficult to read, especially tables in the manual. Cheers Bruno -- Package-specific info: Terminal: xterm-256color $DISPLAY is set. which aptitude: /usr/bin/aptitude aptitude version information: aptitude 0.8.12 Compiler: g++ 9.2.1 20190821 Compiled against: apt version 5.0.2 NCurses version 6.1 libsigc++ version: 2.10.1 Gtk+ support disabled. Qt support disabled. Current library versions: NCurses version: ncurses 6.1.20191019 cwidget version: 0.5.18 Apt version: 5.0.2 aptitude linkage: linux-vdso.so.1 (0x7ffdbffe1000) libapt-pkg.so.5.0 => /lib/x86_64-linux-gnu/libapt-pkg.so.5.0 (0x7f6cff17b000) libncursesw.so.6 => /lib/x86_64-linux-gnu/libncursesw.so.6 (0x7f6cff14) libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x7f6cff111000) libsigc-2.0.so.0 => /lib/x86_64-linux-gnu/libsigc-2.0.so.0 (0x7f6cff108000) libcwidget.so.4 => /lib/x86_64-linux-gnu/libcwidget.so.4 (0x7f6cff002000) libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x7f6cfeed9000) libboost_iostreams.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_iostreams.so.1.67.0 (0x7f6cfeeb9000) libxapian.so.30 => /lib/x86_64-linux-gnu/libxapian.so.30 (0x7f6cfeca) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x7f6cfec7f000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x7f6cfeaa5000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x7f6cfe96) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x7f6cfe946000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f6cfe784000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x7f6cfe76c000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x7f6cfe74f000) libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x7f6cfe73c000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x7f6cfe713000) liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x7f6cfe6f1000) libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x7f6cfe645000) libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x7f6cfe61a000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x7f6cfe572000) /lib64/ld-linux-x86-64.so.2 (0x7f6cff7c5000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7f6cfe56d000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x7f6cfe562000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x7f6cfe557000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x7f6cfe43a000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x7f6cfe417000) -- System Information: Debian Release: bullseye/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 5.4.0-3-amd64 (SMP w/4 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages aptitude depends on: ii aptitude-common 0.8.12-1 ii libapt-pkg5.0 1.8.4 ii libboost-iostreams1.67.0 1.67.0-17 ii libc6 2.29-9 ii libcwidget4 0.5.18-5 ii libgcc1 1:9.2.1-25 ii libncursesw6 6.1+20191019-1 ii libsigc++-2.0-0v5 2.10.2-1 ii libsqlite3-0 3.31.0+really3.30.1+fossil191229-1 ii libstdc++69.2.1-25 ii libtinfo6 6.1+20191019-1 ii libxapian30 1.4.12-1 Versions of packages aptitude recommends: pn libparse-debianchangelog-perl ii sensible-utils 0.0.12+nmu1 Versions of packages aptitude suggests: pn apt-xapian-index