Bug 163594 - broken codepage recoding in editor/view with Ctrl+T
broken codepage recoding in editor/view with Ctrl+T
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-19 07:12 EDT by CTAC
Modified: 2013-07-02 19:08 EDT (History)
3 users (show)

See Also:
Fixed In Version: 4.6.1a-0.17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-03 07:00:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test file with small classic poem (580 bytes, text/plain)
2005-07-19 07:15 EDT, CTAC
no flags Details
Picture of how it shown with wrong or right encoding (65.69 KB, image/jpeg)
2005-07-19 07:17 EDT, CTAC
no flags Details
Picture of how it SHOULD BE with wrong KOI8->CP1251 encoding (75.79 KB, image/jpeg)
2005-07-19 07:19 EDT, CTAC
no flags Details
Patch to fix your problem. (4.21 KB, patch)
2005-08-25 08:56 EDT, Jindrich Novy
no flags Details | Diff
Patch for fixing described issue (777 bytes, patch)
2005-08-31 11:40 EDT, Andy Shevchenko
no flags Details | Diff

  None (edit)
Description CTAC 2005-07-19 07:12:26 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.7.8-1.3.1

Description of problem:
I'm use LANG=ru_RU.koi8r and everything is fine with current version of mc in FC3 (russian menus, input/output, etc)
BUT: just one thing is broken: when I press <Ctrl>+<T> in built-in viewer or editor it shows me small menu to choose encoding of file:
--
- <without enc>
0 7-bit ASCII
1 ISO 8859-1
2 ISO 8859-2
...
Windows 1251
KOI8
...
---
Then I choose encoding and nothing happen! I.E. text is not changing!

Version-Release number of selected component (if applicable):
mc-4.6.1-0.14.FC3 

How reproducible:
Always

Steps to Reproduce:
0.export LANG=ru_RU.koi8r
1.Start mc
2.Menu->Options->Display bits->KOI8-R (and full 8-bit input checked)
3.Open any plain text file with viewer and press <Ctrl>+<T>, choose different encoding 


Actual Results:  Nothing happen

Expected Results:  Changing encoding of showed file. I.e. if it was readable - it will not.
(esp. KOI8-R and Windows-1251 - u'll easily see changing CASE of letters)
I've put 2 pics of this (nekrasov-koi8 is right encoding and nekrasov-cp1251 is wrong encoding on same file)

Additional info:

MC which is included in ASPLinux (http://download.asplinux.ru/i386/updates/10/i386/mc-4.6.1-0.14.0.100asp.i386.rpm) is working fine. But I do not like to rebuild it every time when FC build of MC is changing.
Comment 1 CTAC 2005-07-19 07:15:14 EDT
Created attachment 116919 [details]
Test file with small classic poem

This is a small plain text file with russian text in KOI8-R encoding
Comment 2 CTAC 2005-07-19 07:17:47 EDT
Created attachment 116920 [details]
Picture of how it shown with wrong or right encoding

This is a snapshot of my window with mc when view this file. When I change
encoding with <Ctrl>+<T>, nothing happen
Comment 3 CTAC 2005-07-19 07:19:56 EDT
Created attachment 116922 [details]
Picture of how it SHOULD BE with wrong KOI8->CP1251 encoding

with MC from ASPLinux, I can choose encoding of a file and it changing in my
window!
Comment 4 Jindrich Novy 2005-07-19 07:51:33 EDT
Thanks for the nice bugreport. Could you please check whether you can reproduce
the same thing with the latest development mc version?

This version is downloadable at:
http://people.redhat.com/jnovy/

If this is fixed there, I'll release a FC3 update to fix it.
Comment 5 CTAC 2005-07-19 23:24:55 EDT
# rpm -Uhv http://people.redhat.com/jnovy/files/mc-4.6.1a-0.11.i386.rpm
and everything is fine!!!
thank you!
Comment 6 Jindrich Novy 2005-07-20 06:58:51 EDT
Ok, thanks again for a very good bugreport.
Comment 7 CTAC 2005-08-17 23:39:28 EDT
so, I have mc-4.6.1a-0.11
Bug with 'recoding' in viewer fixed. BUT:
Today I've found the SAME problem with MC built-in text editor (mcedit)
Could you please fix this too?
Comment 8 CTAC 2005-08-17 23:54:38 EDT
version mc-4.6.1a-0.12, builded from src.rpm, have same bug too
Comment 9 Jindrich Novy 2005-08-25 08:56:49 EDT
Created attachment 118107 [details]
Patch to fix your problem.

This patch seems to fix your case by addition of "Current charmap". Please try
to apply this patch to mc-4.6.1a-0.12 (applies smoothly) and let me know
whether it fixes the problem for you.

Thanks.
Comment 10 CTAC 2005-08-29 02:43:41 EDT
does not help at all
"current codepage" and "koi8-r" both.
Comment 11 Andy Shevchenko 2005-08-31 10:02:19 EDT
Hello, all!

Firstly, I should like to note the patch #118107 is not fixed mcedit code. It 
affects on viewer only.

And next, I found viewer problem at mc-4.6.1-1.FC3 release. Please, Jindrich, 
consider the attached patch. (I think this issue comes with new code in 
get_byte()).
Comment 12 Jindrich Novy 2005-08-31 10:33:03 EDT
Hello Andy, can you attach the patch here so that I can review it? Thanks.
Comment 13 Andy Shevchenko 2005-08-31 11:40:15 EDT
Created attachment 118306 [details]
Patch for fixing described issue
Comment 14 Jindrich Novy 2005-10-03 06:46:21 EDT
Andy, thanks for the patch, it's now applied.

Note You need to log in before you can comment on or make changes to this bug.