From patchwork Tue Nov 29 10:08:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 84540 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp2182788obn; Tue, 29 Nov 2016 02:09:21 -0800 (PST) X-Received: by 10.84.143.162 with SMTP id 31mr59941559plz.2.1480414161694; Tue, 29 Nov 2016 02:09:21 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id r7si30643346pli.260.2016.11.29.02.09.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Nov 2016 02:09:21 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-75298-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-75298-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-75298-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=Mu7u Ooek3rq82zOUROOMV1Bhjf5Vc5EMgLHzW29m7ZBFksiAuLKWmcQGnCS8CEtO+pSW 3udAJEdNTgIvZVwhu11XYTg/G+/koGgXPXGGsUKBGBLkzJQPC5Igfdo+aFoorEQr O7/zDdBV69BWByds5nBYIM3DdUFxnkD+mq5PYY8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=E6xwafBaK7 t1WxrgVp4OUKWgDuc=; b=D+KwXrKqkW/GLwXevuaAGDLOObchgo3laK2tQ0P8CO nX4/kHl5AVLKELhzRFL9TTlB1BWhcF/0BdPdJzDNH2rYmcE8PsVOACVCOoMqfcoH qk/+daKlQsJpzdrBXylgyoQt0hanR+y6i9h9cKtH3l90oh2BzrLC9vkyBQ1gBalU k= Received: (qmail 87870 invoked by alias); 29 Nov 2016 10:09:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 87844 invoked by uid 89); 29 Nov 2016 10:09:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=BODY, Euro, euro X-HELO: mx1.redhat.com Subject: Re: [PATCH] localedata: GBK: add mapping for 0x80->Euro sign [BZ #20864] To: Andreas Schwab , Mike Frysinger References: <20161125161735.3823-1-vapier@gentoo.org> Cc: libc-alpha@sourceware.org From: Florian Weimer Message-ID: Date: Tue, 29 Nov 2016 11:08:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: On 11/28/2016 10:23 AM, Andreas Schwab wrote: > FAIL: iconvdata/tst-tables > failed: ./tst-table.sh /home/abuild/rpmbuild/BUILD/glibc-2.24.90.20161127.gb964e06/cc-base/ /home/abuild/rpmbuild/BUILD/glibc-2.24.90.20161127.gb964e06/cc-base/iconvdata/ GBK Here's one way to fix it. Doesn't look really pretty, but it seems that this new 0x80 mapping is quite an outlier. Thanks, Florian gconv: Adjust GBK to support the Euro sign Commit aa4d00ca39e604ac4e9fead401ccd4483e11a281 only updated the data used by locales. 2016-11-29 Florian Weimer * iconvdata/gbk.c (BODY): Add Euro sign support (both directions). diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c index fc32a50..d39e398 100644 --- a/iconvdata/gbk.c +++ b/iconvdata/gbk.c @@ -13148,8 +13148,17 @@ static const char __gbk_from_ucs4_tab12[][2] = if (__builtin_expect (ch <= 0x80, 0) \ || __builtin_expect (ch > 0xfe, 0)) \ { \ - /* This is illegal. */ \ - STANDARD_FROM_LOOP_ERR_HANDLER (1); \ + if (__glibc_likely (ch == 0x80)) \ + { \ + /* Exception for the Euro sign (see CP936). */ \ + ch = 0x20AC; \ + ++inptr; \ + } \ + else \ + { \ + /* This is illegal. */ \ + STANDARD_FROM_LOOP_ERR_HANDLER (1); \ + } \ } \ else \ { \ @@ -13292,6 +13301,10 @@ static const char __gbk_from_ucs4_tab12[][2] = case 0x2010 ... 0x203b: \ cp = __gbk_from_ucs4_tab4[ch - 0x2010]; \ break; \ + case 0x20AC: \ + /* Exception for the Euro sign (see CP396). */ \ + cp = "\x80"; \ + break; \ case 0x2103 ... 0x22bf: \ cp = __gbk_from_ucs4_tab5[ch - 0x2103]; \ break; \