Red Hat Bugzilla – Bug 1116544
[i18n] double width Unicode characters
Last modified: 2014-07-19 02:03:07 EDT
Description of problem:
When I run DNF in Japanese language environment, many lines of display output are longer than the width of screen, so the format of output is collapsed.
I looked in the code and I'm afraid the width of all unicode character is assumed equivalent.
In fact, many asian characters are twice as long width as western alphabet.
Version-Release number of selected component (if applicable):
In python, we can check the width of characters by
Unicode Standard Annex #11
East Asian Width
Created attachment 914946 [details]
patch to fix "dnf repolist all"
Created attachment 914947 [details]
fixed fill_exact_width function and added some functions
Created attachment 914948 [details]
Created attachment 914953 [details]
There was a bug in textwrap_fill function of previous patch for i18n.py. Resending a patch.
Fixed if condition.
In addition, I found my textwrap_fill function insert new line code in a word.
But later problem is not fixed.
Hello, thank you for the report. Can you please try one thing: when doing 'yum repolist all' with your locale settings, does the output look OK? Thanks!
Moving to our i18n guru.
The output of `yum repolist all` looks good.
Yum seems to using self-developed utf8_width function to check the width.
Fixed in the upstream (e42d1de785). Some Yum functions were taken back and refactored to work with unicode literals and some code was reused from Takayuki's patches - Thanks. Next time you can make a pull request here https://github.com/akozumpl/dnf and get all the credit ;).
hawkey-0.4.18-2.fc20, dnf-0.5.4-1.fc20, libsolv-0.6.4-0.git2a5c1c4.fc20 has been submitted as an update for Fedora 20.
hawkey-0.4.18-2.fc20, dnf-0.5.4-1.fc20, libsolv-0.6.4-0.git2a5c1c4.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.