Bug 136826 - MC help does not show Polish characters.
Summary: MC help does not show Polish characters.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mc
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-22 15:25 UTC by Dawid Gajownik
Modified: 2013-07-02 23:03 UTC (History)
3 users (show)

Fixed In Version: 4.6.1-0.9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-11-08 12:51:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
UTF-8ization of help (1.02 KB, patch)
2004-10-25 19:26 UTC, Leonard den Ottolander
no flags Details | Diff
Fixed help patch (1.05 KB, patch)
2004-11-02 16:26 UTC, Leonard den Ottolander
no flags Details | Diff

Description Dawid Gajownik 2004-10-22 15:25:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.8a4)
Gecko/20040927

Description of problem:
Midnight commander help does not show Polish characters. It prints
only spaces :/

I converted appropriate files to UTF-8, but that gave me only 2 spaces
for each non US-ASCII character :)

Version-Release number of selected component (if applicable):
mc-4.6.1-0.8

How reproducible:
Always

Steps to Reproduce:
1. Run mc with LANG=pl_PL.UTF-8
2. Press F1
    

Additional info:

I added to mc.spec this lines:

# convert original files to UTF8
pushd doc
iconv -f iso8859-2 -t utf-8 -o pl/mc.1.in.tmp pl/mc.1.in && mv
pl/mc.1.in.tmp pl/mc.1.in
iconv -f iso8859-2 -t utf-8 -o pl/xnc.hlp.tmp pl/xnc.hlp && mv
pl/xnc.hlp.tmp pl/xnc.hlp
popd

It's weird that it does not work, because convering mc.hint.pl to
UTF-8 resolved the problem with broken tips.

Comment 1 Leonard den Ottolander 2004-10-23 14:14:36 UTC
It is quite possible the UTF-8 patches are incomplete. Hints probably
work due to the utf8-hint patch. After the release of 4.6.1 work on
the UTF-8 patches hopefully continues.


Comment 2 Leonard den Ottolander 2004-10-25 16:51:36 UTC
See also attachment 105723 [details] attached to bug 137036 which also has fixes
to the spec file.


Comment 3 Leonard den Ottolander 2004-10-25 16:52:37 UTC
*** Bug 137036 has been marked as a duplicate of this bug. ***

Comment 4 Leonard den Ottolander 2004-10-25 17:11:20 UTC
The above attachment fixes three issues of which the adding of the
utf-8 patch is rather unimportant. You can ignore it for this issue.
Vladimir Nadvornik will be coming up with a patch soon I hope.


Comment 5 Dawid Gajownik 2004-10-25 17:27:15 UTC
Nice to hear that the work is in progress 8)

Comment 6 Andy Shevchenko 2004-10-25 17:53:57 UTC
utf8 part of attached patch is _additional_ to utf8-hints patch.
May be we can use mbstrlen instead of some code in patch.


Comment 7 Leonard den Ottolander 2004-10-25 19:26:03 UTC
Created attachment 105748 [details]
UTF-8ization of help

Vladimir Nadvornik writes this wrt attachment 105722 [details] (utf-8 help fix):

Thank you for the patch.
However I see some problems:
- calling utf8_to_local() from load_file() is quite dangerous. The hints are
converted twice unless there are adjustments to hints patch.
- there is a memory leak at utf8_to_local call - the original data are not
freed.
- I'd rather use mbrlen instead of handling utf8 directly.
See attached the patch with my changes.

Comment 8 Leonard den Ottolander 2004-11-02 14:39:58 UTC
Above attachment is not entirely correct. p is a const char* and can
thus not be passed to SLsmg_write_nchars. "Unconsting" p is not an
option as it points to a const char* function variable.


Comment 9 Leonard den Ottolander 2004-11-02 16:26:17 UTC
Created attachment 106071 [details]
Fixed help patch

This patch fixes the above mentioned warning. Use of SLsmg_write_char() should
be slightly faster than the use of SLsmg_write_nchars().

Comment 10 Dawid Gajownik 2004-11-02 17:40:51 UTC
I just checked that patch :I I'm not a programmer and I don't know how
it works, but it works ;) Of course I had to convert encoding of
appropriate files to UTF-8.

Big thanks to you all for your effort put into developing mc :)

Comment 11 Jindrich Novy 2004-11-05 13:00:08 UTC
Leonard, the patch doesn't work. I see only double spaces instead of
polish letters and without the patch I see only single space after:

$ LANG=pl_PL.UTF8 mc
+ pressing F1

I applied the patch aganist the UTF-8 patched version, not pure
vanilla CVS, but it has no conflicts with the UTF-8 patches.

Comment 12 Dawid Gajownik 2004-11-05 14:45:13 UTC
> $ LANG=pl_PL.UTF8 mc

This patch works :I There should be LANG=pl_PL.UTF-8 mc

I also noticed by accident, that MC logo is broken with UTF-8 locale.
Run for example LANG=en_US mc or LANG=en_US.UTF-8 mc and then press F1.

Comment 13 Jindrich Novy 2004-11-05 14:51:39 UTC
Dawid, thanks. I didn't notice I mistyped the LANG. The patch is now
applied.

Comment 14 Jindrich Novy 2004-11-08 12:51:29 UTC
The mc-4.6.1-0.9 is just built.


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