Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1743070

Summary: manpage of vim is garbled in Japanese locale
Product: Red Hat Enterprise Linux 7 Reporter: Yuki Okada <yuokada>
Component: vimAssignee: Zdenek Dohnal <zdohnal>
Status: CLOSED ERRATA QA Contact: Petr Sklenar <psklenar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: pmosko, thozza
Target Milestone: rcKeywords: Patch, TestCaseProvided, Triaged
Target Release: ---Flags: thozza: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: vim-7.4.629-7.el7 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1745476 (view as bug list) Environment:
Last Closed: 2020-09-29 19:19:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1745476, 1757052, 1780577    

Description Yuki Okada 2019-08-19 04:21:48 UTC
Description of problem:
manpage of vim is garbled in Japanese locale.

Version-Release number of selected component (if applicable):
vim-common-7.4.160-5.el7 (RHEL 7.6)

How reproducible:
100%

Steps to Reproduce:
1. $ LC_MESSAGES=ja_JP.utf8 man vim

Actual results:

VIM(1)                                     General Commands Manual                                    VIM(1)

å<U+0090>^H<U+0090><U+008D>^H<U+008D>å<U+0089>^H<U+0089><U+008D>^H<U+008D>
       vim - Vi IMproved, ã<U+0083><U+0097>ã<U+0083>ã<U+0082>°ã<U+0083>©ã<U+0083><U+009E>ã<U+0081>®ã<U+0083>
<U+0086>ã<U+0082>ã<U+0082>¹ã<U+0083><U+0088>ã<U+0082>¨ã<U+0083><U+0087>ã<U+0082>£ã<U+0082>¿

æ<U+009B>^H<U+009B>¸å¼<U+008F>^H<U+008F>
       vim [options] [file ..]
       vim [options] -
       vim [options] -t tag
       vim [options] -q [errorfile]
[...]

Expected results:

VIM(1)                                                                                                   General Commands Manual                                                                                                  VIM(1)

名前
       vim - Vi IMproved, プログラマのテキストエディタ

書式
       vim [options] [file ..]
       vim [options] -
       vim [options] -t tag
       vim [options] -q [errorfile]
[...]

Additional info:
- This issue is also reproducible in vim-common-7.4.629-6.el7 (RHEL 7.7) and vim-common-8.0.1763-10.el8 (RHEL 8.0), but NOT reproducible in vim-common-8.1.1790-1.fc30 (Fedora30) and vim-common-8.1.1713-1.fc29 (Fedora29).
- In Fedora, the same issue was reported and fixed in BZ#1035606. (In a spec file, an original UTF-8 file is incorrectly recognized as latin1 and converted from latin1 to UTF-8.)
- According to BZ#1584647, similar issue seems to reappear in recent Fedora. But it was not reproducible in my Fedora 30 or 29 environment.

Comment 3 Zdenek Dohnal 2019-08-19 12:51:36 UTC
Hi Yuki,

thank you for letting me know and investigation!

I can reproduce the issue with steps from Fedora bug.

My suspicion is there is missing if statement in spec scriptlet, which can cause the issue, I'll quickly check.

Comment 4 Zdenek Dohnal 2019-08-19 13:16:25 UTC
diff --git a/vim.spec b/vim.spec
index 2a4486f4..89c619e6 100644
--- a/vim.spec
+++ b/vim.spec
@@ -1739,6 +1739,9 @@ rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/doc/vim2html.pl
 rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/tutor/tutor.gr.utf-8~
 ( cd %{buildroot}/%{_mandir}
   for i in `find ??/ -type f`; do
+    if [[ "`file $i`" == *UTF-8\ Unicode\ text* ]]; then
+      continue
+    fi
     bi=`basename $i`
     iconv -f latin1 -t UTF8 $i > %{buildroot}/$bi
     mv -f %{buildroot}/$bi $i


Fixes the issue.

Comment 5 Yuki Okada 2019-08-21 06:40:14 UTC
Thank you for your quick response.

In RHEL8, you might need to install glibc-langpack-ja package because glibc locales are subpackaged to glibc-langpack-<language>.

https://fedoraproject.org/wiki/Changes/Glibc_locale_subpackaging

Comment 15 errata-xmlrpc 2020-09-29 19:19:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (vim bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3858