Red Hat Bugzilla – Bug 426756
Midnight Commander does not view correctly files with 8-bit characters except in UTF-8 locale
Last modified: 2013-07-02 19:25:04 EDT
Description of problem:
Midnight Commander does not display correctly 8-bit characters in viewer (F3) if
using any 8-bit locale except UTF-8.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Set locale to any non-UTF8 8-bit locale and switch gnome-terminal to that
locale (e.g: export LANG=ru_RU.KOI8-R and switch gnome-terminal to KOI8-R).
2. View (F3) any file containing 8-bit characters, you should see cyrillic
letters instead of most codes with code >= 128.
It displays latin characters (codes < 128) instead of characters with high bit
set. Looks like if the high bit would be somewhere lost.
8-bit characters should be displayed as is.
Half of year ago I found someone's patch that fixes the problem. Unfortunately I
can't remember where I found it since I haven't intended to submit it anywhere,
just that I kept recompiling mc with every update, but now I see that it takes
too long to wait till this bug hits the trunk. The patch is attached.
Created attachment 290385 [details]
A simple patch that fixes the bug (not mine)
Jindrich and Andrew, this patch is taken straight from bug #188079 (patch
#128659). The original author is Dmitry Butskoy (and he should take credit in
Jindrich, somehow you let us wait 2 years for the apply and all that was needed
was to open a new bug for you to see. I'll try to use that tactics for my other
bugs, thanks for a tip.
*** Bug 188079 has been marked as a duplicate of this bug. ***
With UTF-8 support in mc now correct work with one-byte charsets.
Now possible to edit/view UTF-8 files with 8-bit system charset and possible to edit/view 8-bit files with UTF-8 system charset.
Also, possible to recode filenames/dirnames in left/right panel (and recode names on-fly while copy/move, of course)