Bug 1414263

Summary: glibc: add ibm-858 to list of charsets for iconv
Product: Red Hat Enterprise Linux 7 Reporter: Konstantin Trufanov <ktrufano>
Component: glibcAssignee: Arjun Shankar <ashankar>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: low Docs Contact:
Priority: low    
Version: 7.2CC: ashankar, codonell, cww, fweimer, jplesnik, mfabian, mnewsome, pfrankli, skolosov
Target Milestone: rcKeywords: FutureFeature, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glibc-2.17-293.el7 Doc Type: Enhancement
Doc Text:
Feature: Support for IBM858 character encoding Result: The iconv function and iconv program now support encoding to and from the IBM858 character encoding.
Story Points: ---
Clone Of:
: 1416405 (view as bug list) Environment:
Last Closed: 2020-03-31 19:08:29 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: 1416405    
Bug Blocks: 1594286, 1710255    

Description Konstantin Trufanov 2017-01-18 08:23:58 UTC
Description of problem:

Not possible to encode/decode the character sets IBM-858 (file coming from a IBM Zos) with iconv

Version-Release number of selected component (if applicable):

any

Additional info:

The closest charset is CP850, but it doesn't have the euro character EURO (€).

Comment 1 Jitka Plesnikova 2017-01-18 09:19:24 UTC
perl-Text-Iconv provides only a Perl interface to the iconv() function.

iconv is part of glibc-common.
# rpm -qf /usr/bin/iconv
glibc-common-2.17-157.el7_3.1.x86_64

Comment 5 Carlos O'Donell 2019-06-07 20:31:11 UTC
We now have IBM858 upstream thanks to the Red Hat i18n team (Mike Fabian).
~~~
commit 799c8d6905433ad56f26ccab4855b36f1d1ddbfc
Author: Mike FABIAN <mfabian>
Date:   Thu Sep 7 15:28:28 2017 +0200

    Add new codepage charmaps/IBM858 [BZ #21084]
    
    This code page is identical to code page 850 except that X'D5'
    has been changed from LI61 (dotless i) to SC20 (euro symbol).
   
    The code points from /x01 to /x1f in the /localedata/charmaps/IBM858
    file have the same mapping as those in localedata/charmaps/ANSI_X3.4-1968.
    That means they disagree with with
    
    ftp://ftp.software.ibm.com/software/globalization/gcoc/attachments/CP00858.txt
    
    in that range.
    For example, localedata/charmaps/IBM858 and localedata/charmaps/ANSI_X3.4-1968 have:
    
       “<U0001>     /x01         START OF HEADING (SOH)”
    
    whereas CP00858.txt has:
    
       “01 SS000000        Smiling Face”
    
    That means that CP00858.txt is not really ASCII-compatible and to make
    it ASCII-compatible we deviate fro CP00858.txt in the code points from /x01
    to /x1f.
    
            [BZ #21084]
            * benchtests/strcoll-inputs/filelist#en_US.UTF-8: Add IBM858 and ibm858.c.
            * iconvdata/Makefile: Add IBM858.
            * iconvdata/gconv-modules: Add IBM858.
            * iconvdata/ibm858.c: New file.
            * iconvdata/tst-tables.sh: Add IBM858
            * localedata/charmaps/IBM858: New file.
~~~
This is already fixed in RHEL 8.0 so no need to backport there.

Comment 6 Arjun Shankar 2019-07-25 16:07:37 UTC
IBM858 is almost identical to IBM850 except for the inclusion of Euro sign.
Here are a couple of tests to verify that the character encoding is supported and works:

echo -e '\xd5' | iconv -f IBM858 -t UTF-8
 # should generate a UTF-8 "Euro" sign

echo -en '\xe2\x82\xac' | iconv -f UTF-8 -t IBM858 > ibm858.euro
 # should generate a single byte 'ibm858.euro' file with content 'd5'

Comment 8 Sergey Kolosov 2019-10-07 14:31:43 UTC
Verified with iconv

Comment 10 errata-xmlrpc 2020-03-31 19:08:29 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, 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:0989