Bug 141875 - Query dialogs too wide when using utf8
Query dialogs too wide when using utf8
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-04 09:49 EST by Nickolay V. Shmyrev
Modified: 2013-07-02 19:03 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-16 08:58:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch (696 bytes, patch)
2004-12-04 09:50 EST, Nickolay V. Shmyrev
no flags Details | Diff
Simplified msglen patch (705 bytes, patch)
2004-12-06 05:24 EST, Jindrich Novy
no flags Details | Diff
F10 query dialog (58.22 KB, image/png)
2004-12-13 00:16 EST, sangu
no flags Details
*Suspected* fix (672 bytes, patch)
2004-12-14 16:30 EST, Leonard den Ottolander
no flags Details | Diff
Patch to fix the multiple character wide UTF-8 chars (812 bytes, patch)
2004-12-15 07:03 EST, Jindrich Novy
no flags Details | Diff

  None (edit)
Description Nickolay V. Shmyrev 2004-12-04 09:49:30 EST
Description of problem:

If you ll try to exit from mc by pressing F10, the dialog about exit
will be too wide in russian locale.

The reason of it is wrong imlementation of msglen function in utils.c
Comment 1 Nickolay V. Shmyrev 2004-12-04 09:50:43 EST
Created attachment 107893 [details]
Patch

Sorry, if it is already resolved.
Comment 2 Jindrich Novy 2004-12-06 04:25:04 EST
Hello Nickolay,

it seems it's not yet resolved. I can reproduce the bug on standard
80x25 terminal so the query dialog should be fixed.
Comment 3 Jindrich Novy 2004-12-06 05:24:30 EST
Created attachment 107939 [details]
Simplified msglen patch

Nickolay, I modified the patch a bit so it's a bit simplier now.
Comment 4 Jindrich Novy 2004-12-07 04:57:29 EST
Committed. Thanks for the bugreport.
Comment 5 Nickolay V. Shmyrev 2004-12-07 10:20:57 EST
Nice. Thanks a lot.
Comment 6 sangu 2004-12-13 00:16:35 EST
Created attachment 108420 [details]
F10 query dialog

Messages is wide of F10 Query dialog in locale ko_KR.UTF-8 or ja_JP.UTF-8.

mc version is 4.6.1a-0.1.
Comment 7 Jindrich Novy 2004-12-14 08:27:25 EST
Sangu, it looks like the msglen patch should be reworked a bit. I'll
have a look at it. Any suggestions from you are welcome.
Comment 8 Leonard den Ottolander 2004-12-14 16:30:04 EST
Created attachment 108571 [details]
*Suspected* fix

Sorry for not butting in quicker. I was aware of Egmont Koblingers UTF-8 fixes
for UHU Linux but couldn't find back the link as I don't speak Hungarian ;) .

I suspect this patch might fix this issue. The name and the location of the
patch code indicates this. Please confirm.
Comment 9 Egmont Koblinger 2004-12-14 17:24:06 EST
I guess my patch (posted by Leonard) is exactly as good or as bad
as Jindrich's patch. We both count the number of Unicode entities
and don't handle double-width characters correctly. Somewhere a
wcwidth() or wcswidth() should be inserted.

Jindrich's patch seems to be easier to modify since he already calls
mbrtowc(), it should store the resulted wide character somewhere
and then call wcwidth() on it to determine whether it's double width.

Imho it'd be nice to write an mbwidth() and mbswidth() once since
it might be useful in a lot of places in the whole mc.
Comment 10 Egmont Koblinger 2004-12-14 17:36:05 EST
Btw just if anyone is interested in it :-)) the link mentioned by
Leonard, pointing to the source repository of the packages of a
Hungarian distribution called UHU-Linux is:
https://svn.uhulinux.hu/packages/dev/mc/

The patches are inside the 'patches' directory, the utf-8 related
ones currently begin with 00- and the one posted by Leonard is 00-71.
Comment 11 Jindrich Novy 2004-12-15 07:03:23 EST
Created attachment 108601 [details]
Patch to fix the multiple character wide UTF-8 chars

Any objections?
Comment 13 Jindrich Novy 2004-12-16 08:58:39 EST
Fixed in mc-4.6.1a-0.2.

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