Bug 426756

Summary: Midnight Commander does not view correctly files with 8-bit characters except in UTF-8 locale
Product: [Fedora] Fedora Reporter: Andrew Zabolotny <anpaza>
Component: mcAssignee: Jindrich Novy <jnovy>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: lam, pknirsch, slavazanko
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-27 13:34:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A simple patch that fixes the bug (not mine) none

Description Andrew Zabolotny 2007-12-25 21:47:04 UTC
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):
4.6.1a-50.20070604cvs.fc8

How reproducible:
Always

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.
  
Actual results:
It displays latin characters (codes < 128) instead of characters with high bit
set. Looks like if the high bit would be somewhere lost.

Expected results:
8-bit characters should be displayed as is.

Additional info:
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.

Comment 1 Andrew Zabolotny 2007-12-25 21:47:04 UTC
Created attachment 290385 [details]
A simple patch that fixes the bug (not mine)

Comment 2 Jindrich Novy 2008-03-27 13:34:41 UTC
Applied, thanks!

Comment 3 Leszek Matok 2008-07-05 06:05:52 UTC
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
the changelog).

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.

Comment 4 Dmitry Butskoy 2008-07-07 12:23:02 UTC
*** Bug 188079 has been marked as a duplicate of this bug. ***

Comment 5 Slava Zanko 2009-05-25 22:09:14 UTC
http://www.midnight-commander.org/ticket/2

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)