#1143173 reportbug: mcedit cannot convert ISO-8859-1 encoding because mc.charsets contains untranslated encoding key

Package:
mc
Source:
mc
Description:
Midnight Commander - a powerful file manager
Submitter:
Massimiliano
Date:
2026-08-18 05:45:01 UTC
Severity:
normal
#1143173#5
Date:
2026-07-31 09:06:53 UTC
From:
To:
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.

#1143173#10
Date:
2026-08-18 05:11:46 UTC
From:
To:
The variable ENCODING_ISO8859 in m4.include/mc-i18n.m4 gets set, but is
forgotten to be exported. That's fixed upstream in a later encodings overhaul,
but for now a patch I attached here can be useful.