From owner-freebsd-tcltk@freebsd.org Tue Nov 10 16:33:27 2015 Return-Path: Delivered-To: freebsd-tcltk@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0BBBA2B43C for ; Tue, 10 Nov 2015 16:33:27 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id A74D715EA for ; Tue, 10 Nov 2015 16:33:27 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mailman.ysv.freebsd.org (Postfix) id A3F8CA2B43B; Tue, 10 Nov 2015 16:33:27 +0000 (UTC) Delivered-To: tcltk@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A395BA2B43A for ; Tue, 10 Nov 2015 16:33:27 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0F415E5 for ; Tue, 10 Nov 2015 16:33:27 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lfs39 with SMTP id 39so1187947lfs.3 for ; Tue, 10 Nov 2015 08:33:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=p2Xvq55U3ghXzeS+OTEGgxnXwVx1z8DO1HegHhTspFc=; b=hXamjd0DIrBmBnt78/QH1wxONfRYwgAxpguGFFKybQzOfeDzDSQpwdA11HSbLSe0Tj gzG5GLHoqFkLxedIfm+vOIaVemTZMWjys/q5g+ZRaiLvtV4OMJzCmlFrxwUEq3qtf0KB VoCtRVGsOxl7LL14xAmpKqzMHeenbkmc9zOnSBy0IzCUQ2pfWeMVdO49d7/C1d9tG2bv sMCCPx7+tMa0k7HuBQB5k4U8YCa8cG9E1L+kLAGQVp3Ev4zf5Lzl7uOV6rjRDWlUrZHJ EPtW88GmvcnndO7pSJrAcc1DLXhvbO3WaxunUj/k+NoS3pO2fqJBNOkb5MelOH8sWV95 W6WA== X-Gm-Message-State: ALoCoQkKkh8cLKCVopMoo4rQJMp2ocFFCvkkPl86PEzIosIVn4qmBMgXRrOnb2qnBN/zWkXcLtGB X-Received: by 10.25.39.135 with SMTP id n129mr2122847lfn.60.1447173205374; Tue, 10 Nov 2015 08:33:25 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id yp7sm651697lbb.47.2015.11.10.08.33.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 08:33:24 -0800 (PST) Subject: Re: svn commit: r290637 - head/lib/libc/locale To: Baptiste Daroussin References: <201511100811.tAA8BR0R034338@repo.freebsd.org> <5641E7B4.2070508@freebsd.org> <20151110130430.GK10134@ivaldir.etoilebsd.net> <5641EF26.8060600@freebsd.org> <20151110133615.GL10134@ivaldir.etoilebsd.net> <5642163E.1050405@freebsd.org> <20151110161204.GM10134@ivaldir.etoilebsd.net> <56421923.7080601@freebsd.org> Cc: tcltk@FreeBSD.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Andrey Chernov Message-ID: <56421C53.8080508@freebsd.org> Date: Tue, 10 Nov 2015 19:33:23 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56421923.7080601@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="am5Kka7H6VhIIcTiKgWO1ApUdUOSSaPkD" X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 16:33:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --am5Kka7H6VhIIcTiKgWO1ApUdUOSSaPkD Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 10.11.2015 19:19, Andrey Chernov wrote: > On 10.11.2015 19:12, Baptiste Daroussin wrote: >> On Tue, Nov 10, 2015 at 07:07:26PM +0300, Andrey Chernov wrote: >>> On 10.11.2015 16:36, Baptiste Daroussin wrote: >>>> On Tue, Nov 10, 2015 at 04:20:38PM +0300, Andrey Chernov wrote: >>>>> On 10.11.2015 16:04, Baptiste Daroussin wrote: >>>>>> On Tue, Nov 10, 2015 at 03:48:52PM +0300, Andrey Chernov wrote: >>>>>>> On 10.11.2015 11:11, Baptiste Daroussin wrote: >>>>>>>> Author: bapt >>>>>>>> Date: Tue Nov 10 08:11:27 2015 >>>>>>>> New Revision: 290637 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/290637 >>>>>>>> >>>>>>>> Log: >>>>>>>> return "US-ASCII" instead of "POSIX" for "C" and "POSIX" local= es >>>>>>>> as it used to be in previous version of the locales. Returning= >>>>>>>> "POSIX" has too many fallouts. >>>>>>> >>>>>>> You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to b= e >>>>>>> different with real US-ASCII. It is what glibc returns for C/POSI= X >>>>>>> locale and most ports expected, being linux-oriented. >>>>>>> >>>>>> I thought about it, but in the end it is probably safer for now th= at nl_langinfo >>>>>> return US-ASCII as it did in the past, to reduce breakage with Fre= eBSD only code >>>>>> that maybe be existing ou there. >>>>> >>>>> All FreeBSD code I know never check locale this way. IMHO probabili= ty of >>>>> potential danger to meet some linux-oriented port with this check i= s >>>>> much much higher than to meet similar FreeBSD only code in the wild= =2E In >>>>> any case, changing collate order from A-Za-z to aA-zZ we do just no= w >>>>> have much higher probability to break unknown FreeBSD only code, so= one >>>>> breaking change can go with other one together. >>>>> >>>> That is true, except that the new collation thing is invalidated as = soon as you >>>> set LC_COLLATE=3DC which bring your back to A-Za-z. So you have a wo= rkaround while >>>> changing the return value of nl_langinfo() is not workaroundable. >>> >>> Well, forget my improper comparison with collate and see this bug in >>> action right now, in our port tcl8.6.4/unix/tclUnixInit.c: >>> >>> See localeTable and comment above it, there is internal "ansi_x3.4-19= 68" >>> (i.e. POSIX locale), internal "ascii" and even no alias for our >>> "us-ascii" at all. >>> >>> It gets info through nl_langinfo(CODESET), lowercased. I.e. not using= >>> "ANSI_X3.4-1968" breaks all tcl ports right now, this is more essenti= al >>> than hypothetical private FreeBSD only code no one see. >> >> That one is a valid point, that also means that is is broken right now= on >> FreeBSD 10 and below? >=20 > Yes. It can't map our C locale to the some of internal ones and falls > back to TCL_DEFAULT_ENCODING "iso8859-1" >=20 BTW, for pure ASCII locale readded we should return "ASCII" instead of "US-ASCII". I search lots of Linux code and see many checks for "ASCII" and no checks for "US-ASCII" (like in tcl too). --=20 http://ache.vniz.net/ --am5Kka7H6VhIIcTiKgWO1ApUdUOSSaPkD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWQhxTAAoJEKUckv0MjfbKnbYIAMLfjFCut/E4y6+HFpN4NLfs Id/m+XiHOKHbb65aUBBpu0a5OzlMbYpD1d51QASWFb1gKaqR3TQ4bh8ybmMueWLM MZvS7BIvPnwhdi5/u6MaiLS0+H5TpiSp6QkkHn1Mxx9k1iZiTqIIAsGAWor13Wje DoHZM5Jrdqn4YG9G/RgtfrgsoAsJGqEKFChWNBktzh8ykvdTH/OSaBkcZowqptsq wYdHGxABS6+RuB0Zfvjs/v/iu5rCLnqj+oaXY/QVZUH6wmJ16+fkIKPeXEDiD+M5 vF0/UaWivd7V5a9CHL9lgZdEZoE3W40vfkUcIEFBh606jDgYHhvDwfzkaebrjOk= =CK2Q -----END PGP SIGNATURE----- --am5Kka7H6VhIIcTiKgWO1ApUdUOSSaPkD--