Bug 1116544 - [i18n] double width Unicode characters
[i18n] double width Unicode characters
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
20
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Honza Silhan
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-05 23:51 EDT by Takayuki Ogawa
Modified: 2014-07-19 02:03 EDT (History)
6 users (show)

See Also:
Fixed In Version: hawkey-0.4.18-2.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-07-19 02:03:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to fix "dnf repolist all" (6.75 KB, patch)
2014-07-06 07:00 EDT, Takayuki Ogawa
no flags Details | Diff
fixed fill_exact_width function and added some functions (2.09 KB, patch)
2014-07-06 07:02 EDT, Takayuki Ogawa
no flags Details | Diff
fixed output. (21.38 KB, patch)
2014-07-06 07:04 EDT, Takayuki Ogawa
no flags Details | Diff
There was a bug in textwrap_fill function of previous patch for i18n.py. Resending a patch. (2.08 KB, patch)
2014-07-06 09:40 EDT, Takayuki Ogawa
no flags Details | Diff

  None (edit)
Description Takayuki Ogawa 2014-07-05 23:51:40 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):
dnf-0.5.2-1.fc20.noarch

Additional information:
In python, we can check the width of characters by
unicodedata.east_asian_width function.

Unicode Standard Annex #11
East Asian Width
http://www.unicode.org/reports/tr11/
Comment 1 Takayuki Ogawa 2014-07-06 07:00:03 EDT
Created attachment 914946 [details]
patch to fix "dnf repolist all"
Comment 2 Takayuki Ogawa 2014-07-06 07:02:44 EDT
Created attachment 914947 [details]
fixed fill_exact_width function and added some functions
Comment 3 Takayuki Ogawa 2014-07-06 07:04:49 EDT
Created attachment 914948 [details]
fixed output.
Comment 4 Takayuki Ogawa 2014-07-06 09:40:40 EDT
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.
Comment 5 Ales Kozumplik 2014-07-07 02:31:43 EDT
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.
Comment 6 Takayuki Ogawa 2014-07-07 07:39:43 EDT
The output of `yum repolist all` looks good.
Yum seems to using self-developed utf8_width function to check the width.
Thank you.
Comment 7 Honza Silhan 2014-07-14 13:07:58 EDT
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 ;).
Comment 8 Fedora Update System 2014-07-17 02:42:38 EDT
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.
https://admin.fedoraproject.org/updates/hawkey-0.4.18-2.fc20,dnf-0.5.4-1.fc20,libsolv-0.6.4-0.git2a5c1c4.fc20
Comment 9 Fedora Update System 2014-07-19 02:03:07 EDT
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.

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