Red Hat Bugzilla – Bug 141875
Query dialogs too wide when using utf8
Last modified: 2013-07-02 19:03:53 EDT
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
Created attachment 107893 [details]
Sorry, if it is already resolved.
it seems it's not yet resolved. I can reproduce the bug on standard
80x25 terminal so the query dialog should be fixed.
Created attachment 107939 [details]
Simplified msglen patch
Nickolay, I modified the patch a bit so it's a bit simplier now.
Committed. Thanks for the bugreport.
Nice. Thanks a lot.
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.
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.
Created attachment 108571 [details]
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.
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.
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:
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.
Created attachment 108601 [details]
Patch to fix the multiple character wide UTF-8 chars
Fixed in mc-4.6.1a-0.2.