Package: mc
Version: 3:4.8.33-1+deb13u1
Severity: normal
X-Debbugs-Cc: [email protected]
Dear Maintainer,
when using mcedit to convert a file from ISO-8859-1 to UTF-8, the conversion
fails with:
Cannot translate from @ENCODING_ISO8859-1 to UTF-8
The error is reproducible also with:
LANG=C mcedit
so it is not related to the system locale or gettext translation.
Steps to reproduce:
1. Install mc on Debian 13.
2. Open a file encoded as ISO-8859-1 with mcedit.
3. Select the ISO-8859-1 encoding conversion to UTF-8.
4. The conversion fails.
Relevant file:
/usr/share/mc/mc.charsets
contains:
@ENCODING_ISO8859@-1 ISO 8859-1
The first field appears to be a gettext placeholder rather than a valid iconv
charset name.
Workaround:
Changing the first field to the real charset name fixes the problem:
from:
@ENCODING_ISO8859@-1 ISO 8859-1
to:
ISO-8859-1 ISO 8859-1
After this change mcedit correctly converts ISO-8859-1 files to UTF-8.
Expected behavior:
mcedit should use the actual charset identifier (ISO-8859-1) when invoking
iconv, while still allowing the display name to be localized.
Actual behavior:
mcedit passes the untranslated string @ENCODING_ISO8859@-1 to iconv, causing
the conversion failure.
Additional information:
The following checks were performed:
- iconv supports ISO-8859-1 conversion.
- locale configuration is correct.
- mc and mc-data versions are identical.
- The issue disappears after correcting mc.charsets.
Possible cause:
The parser handling mc.charsets seems to use the first column directly as the
iconv charset name instead of resolving the gettext placeholder.
-- System Information:
Debian Release: 13.6
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.94+deb13-cloud-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages mc depends on:
ii libc6 2.41-12+deb13u3
ii libext2fs2t64 1.47.2-3+b11
ii libglib2.0-0t64 2.84.4-3~deb13u3
ii libgpm2 1.20.7-11+b2
ii libslang2 2.3.3-5+b2
ii libssh2-1t64 1.11.1-1+deb13u1
ii mc-data 3:4.8.33-1+deb13u1
Versions of packages mc recommends:
ii mailcap 3.74
ii perl 5.40.1-6
ii sensible-utils 0.0.25
ii unzip 6.0-29
Versions of packages mc suggests:
pn antiword <none>
pn arc | arcanist <none>
pn arj <none>
ii binutils 2.44-3
ii bzip2 1.0.8-6
pn cabextract <none>
pn catdoc <none>
pn clzip | lunzip | lzd | lzip | lziprecover | mi <none>
nilzip | pdlzip | plzip
ii cpio 2.15+dfsg-2
pn ctorrent <none>
pn dbview <none>
pn default-jdk-headless <none>
pn djview4 <none>
pn djvulibre-bin <none>
pn elinks <none>
pn epub-utils | ncbi-entrez-direct <none>
ii evince [pdf-viewer] 48.1-3+deb13u1
pn exif <none>
ii file 1:5.46-5
pn genisoimage <none>
pn gettext <none>
ii ghostscript 10.05.1~dfsg-1+deb13u1
pn glade <none>
pn gputils <none>
ii groff-base 1.23.0-9
pn gv <none>
ii imagemagick 8:7.1.1.43+dfsg1-1+deb13u11
ii imagemagick-7.q16 [imagemagick] 8:7.1.1.43+dfsg1-1+deb13u11
pn info <none>
pn jlha-utils | lhasa <none>
pn kchmviewer <none>
pn libaspell-dev <none>
pn libbatik-java <none>
pn libchm-bin <none>
pn liblz4-tool <none>
pn libxml2-utils <none>
pn links2 <none>
pn lyx <none>
ii man-db 2.13.1-1
pn mikmod <none>
pn mpg321 <none>
pn mplayer <none>
pn odt2txt | unoconv <none>
pn p7zip-full <none>
pn par2 <none>
pn poedit | potool <none>
ii poppler-utils 25.03.0-5+deb13u4
pn procyon-decompiler <none>
ii python3 3.13.5-1
pn python3-boto <none>
pn python3-tz <none>
pn rar <none>
pn rpm <none>
pn sox <none>
pn sqlite3 <none>
pn texlive-binaries <none>
pn timidity <none>
pn unace | unace-nonfree <none>
pn unalz <none>
pn unar <none>
pn unrar | unrar-free <none>
pn vorbis-tools <none>
ii w3m 0.5.3+git20230121-2.1
pn wimtools <none>
pn wv <none>
pn xpmutils <none>
ii xz-utils 5.8.1-1+deb13u1
ii zip 3.0-15
ii zstd 1.5.7+dfsg-1
-- no debconf information