Bug 163594 - broken codepage recoding in editor/view with Ctrl+T
Summary: broken codepage recoding in editor/view with Ctrl+T
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
(Show other bugs)
Version: 3
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-19 11:12 UTC by CTAC
Modified: 2013-07-02 23:08 UTC (History)
3 users (show)

Fixed In Version: 4.6.1a-0.17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-03 11:00:12 UTC
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 11:15 UTC, CTAC
no flags Details
Picture of how it shown with wrong or right encoding (65.69 KB, image/jpeg)
2005-07-19 11:17 UTC, CTAC
no flags Details
Picture of how it SHOULD BE with wrong KOI8->CP1251 encoding (75.79 KB, image/jpeg)
2005-07-19 11:19 UTC, CTAC
no flags Details
Patch to fix your problem. (4.21 KB, patch)
2005-08-25 12:56 UTC, Jindrich Novy
no flags Details | Diff
Patch for fixing described issue (777 bytes, patch)
2005-08-31 15:40 UTC, Andy Shevchenko
no flags Details | Diff

Description CTAC 2005-07-19 11:12:26 UTC
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 11:15:14 UTC
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 11:17:47 UTC
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 11:19:56 UTC
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 11:51:33 UTC
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-20 03:24:55 UTC
# 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 10:58:51 UTC
Ok, thanks again for a very good bugreport.

Comment 7 CTAC 2005-08-18 03:39:28 UTC
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-18 03:54:38 UTC
version mc-4.6.1a-0.12, builded from src.rpm, have same bug too

Comment 9 Jindrich Novy 2005-08-25 12:56:49 UTC
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 06:43:41 UTC
does not help at all
"current codepage" and "koi8-r" both.

Comment 11 Andy Shevchenko 2005-08-31 14:02:19 UTC
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 14:33:03 UTC
Hello Andy, can you attach the patch here so that I can review it? Thanks.

Comment 13 Andy Shevchenko 2005-08-31 15:40:15 UTC
Created attachment 118306 [details]
Patch for fixing described issue

Comment 14 Jindrich Novy 2005-10-03 10:46:21 UTC
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.