Bug 136826 - MC help does not show Polish characters.
MC help does not show Polish characters.
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
Depends On:
  Show dependency treegraph
Reported: 2004-10-22 11:25 EDT by Dawid Gajownik
Modified: 2013-07-02 19:03 EDT (History)
3 users (show)

See Also:
Fixed In Version: 4.6.1-0.9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-11-08 07:51:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Dawid Gajownik 2004-10-22 11:25:31 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.8a4)

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):

How reproducible:

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

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 10:14:36 EDT
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 12:51:36 EDT
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 12:52:37 EDT
*** Bug 137036 has been marked as a duplicate of this bug. ***
Comment 4 Leonard den Ottolander 2004-10-25 13:11:20 EDT
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 13:27:15 EDT
Nice to hear that the work is in progress 8)
Comment 6 Andy Shevchenko 2004-10-25 13:53:57 EDT
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 15:26:03 EDT
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
- 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 09:39:58 EST
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 11:26:17 EST
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 12:40:51 EST
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 08:00:08 EST
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 09:45:13 EST
> $ 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 09:51:39 EST
Dawid, thanks. I didn't notice I mistyped the LANG. The patch is now
Comment 14 Jindrich Novy 2004-11-08 07:51:29 EST
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.