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.