From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SM+0EIOIVmKJVAEAgWs5BA (envelope-from ) for ; Wed, 13 Apr 2022 10:23:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id QGIJDoOIVmLdCwEA9RJhRA (envelope-from ) for ; Wed, 13 Apr 2022 10:23:31 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C43812120D for ; Wed, 13 Apr 2022 10:23:30 +0200 (CEST) Received: from localhost ([::1]:46098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neYHh-0004hK-9y for larch@yhetil.org; Wed, 13 Apr 2022 04:23:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neYHG-0004gz-1m for bug-guix@gnu.org; Wed, 13 Apr 2022 04:23:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1neYHF-0002nj-NC for bug-guix@gnu.org; Wed, 13 Apr 2022 04:23:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1neYHF-0001et-K8 for bug-guix@gnu.org; Wed, 13 Apr 2022 04:23:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#54893: guix-daemon, locale, LANG, and unicode in git tag names Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 13 Apr 2022 08:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54893 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai Received: via spool by 54893-submit@debbugs.gnu.org id=B54893.16498381606325 (code B ref 54893); Wed, 13 Apr 2022 08:23:01 +0000 Received: (at 54893) by debbugs.gnu.org; 13 Apr 2022 08:22:40 +0000 Received: from localhost ([127.0.0.1]:51534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neYGt-0001dx-KX for submit@debbugs.gnu.org; Wed, 13 Apr 2022 04:22:39 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:40984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neYGr-0001dn-8M for 54893@debbugs.gnu.org; Wed, 13 Apr 2022 04:22:38 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id J8Na2700Q4UW6Th018NbGV; Wed, 13 Apr 2022 10:22:35 +0200 Message-ID: From: Maxime Devos Date: Wed, 13 Apr 2022 10:22:30 +0200 In-Reply-To: <4sSjKaCcadx8brYQC5HZuP-SyMku3BlXRTZwaCUH13qSv01N33lk9vyUWzzE6R889ZuQRpI_6Pl4Q_51v8jMhUhwh6f9rly5h0EhlUqHG80=@lendvai.name> References: <4sSjKaCcadx8brYQC5HZuP-SyMku3BlXRTZwaCUH13qSv01N33lk9vyUWzzE6R889ZuQRpI_6Pl4Q_51v8jMhUhwh6f9rly5h0EhlUqHG80=@lendvai.name> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-zcUf8ykWE3j8bVzGdQX2" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1649838155; bh=fNIwun+vn9QaUoWtQUbidXGZ0wpHanMfsE8dx+cbEUs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=onU5ON+CX/L7pYGTs+uWL8PnlWheY4P6P8wtV5ijiq4XlF4FxlvWcVaoiUB2fylYl /TTZMonI/NdvHL/tYIZLstSd7FZ8bGJx1bLS9pyAQeqKpyCG0x2o9iKu9uwCDBrQvX YUstIsuDKLF7trUZOyB8cP+NJKYP0m07OZ5HqGdTBwnZFydrgGHshIxq+Tfq6tblmq RjJhijjmiXUYoWOaw4ansdvdDHzaqIBwGM3Xe7VXsgzPu/du8MB3SGANYDAtj6mJlI VM4LU1pm5imRuMJtHzeLoWYMFxt5NjRLzLG1swJ+RbXNxPz5Z1s/kpJ8/rFw/kpfb8 WJIsSzywYIAMA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 54893@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649838210; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=fNIwun+vn9QaUoWtQUbidXGZ0wpHanMfsE8dx+cbEUs=; b=Hb2ShBT66qbKpDq93H39R2Joi0XHHFDXszqbBJK1mXJTKf0RYZwDiOpCcXKH0a9teD46Fc bTax02TyhJT1DvscM4IAFS4eGwaCYzES4acROY3Hi6jsJBHIXh9bwj2rtSIbPINaoAwWKS tM9C1W8kX55ovrIGRSCs0OHFtLBrC/mc3PnHSY20aHDdmOjaiodgP2LkrH+H9ewk3Wdc0s UaIDMieFDcdbxTlQLMrANu3zdBKFk6IgBJaqwrebq2loH81dHdAZ3sf+0nXVrkUiBd/VGo 7ReKTB5YSYq1t3kVhJ32m/qNTzyw9CwxlN/4F8haG6iGuRTybOXKsWfD/p/5lQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649838210; a=rsa-sha256; cv=none; b=cgdneW604qM2++VRYlRVWL3ZGgCY2LXFLhKBDDZ+KjkP/ctqS/LsssVHU/T+bMeDdr7r3F ociWdanuo6fIRQP8JAG6umN92JJXmEYY/TtpzJClm2nstIB54ZtLrUS2B9KMdqkwTekWDb 8s2dKS1eTRZ2oX9HVO2hTlkjctbqfQ9M7u6KdT+afaWOU+r6/HsuW96B7rBzPVR1hpCIl9 Smk8umwUm52atYkm7vKFRkqgIdaGIREOe8rX9HcSh4yFiIsynVdxXgTzMmFYpe3T+MywKN rpFO4JaBXOhechae/a3oHMUj6HL6iePtTkSHXoBvgV+qxnfBHm+ZNOEairhfgg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=onU5ON+C; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=onU5ON+C; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C43812120D X-Spam-Score: 2.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5S6qFzoLNYBs --=-zcUf8ykWE3j8bVzGdQX2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attila Lendvai schreef op wo 13-04-2022 om 07:51 [+0000]: > i'm not sure why the wrong locale breaks file-system walking and deleting= , though. >=20 > i assume if every function in guile uses/assumes the same locale (charact= er > encoding), then both directions through the guile FFI should be idempoten= t, no? > and i think both ASCII and UTF-8 are idempotent wrt C bytes <-> scheme st= ring > conversions. The problem is that the default character encoding is ANSI_X3.4-1968 (US-ASCII) and any bytes above 127 makes things non-ASCII. Also, the string procedures internally always use UTF-8 (or possibly ISO-85519-1 as an optimisation?), they are not raw bytes instead they can be consideres a vector of characters (string-ref returns characters, not bytes, and doesn't use byte positions). > IOW, it's only the displaying of the chars that should be broken, > not file operations. LANG=3Dbogus guile (guile-user)> (setlocale LC_ALL) (guile-user)> (use-modules (ice-9 i18n)) (guile-user)> (locale-encoding) (guile-user)> (locale-encoding) $2 =3D "ANSI_X3.4-1968" Apparently the fallback encoding is =E2=80=98ANSI_X3.4-1968=E2=80=99. Let'= s take a look at this encoding. According to IANA (https://www.iana.org/assignments/character-sets/character-sets.xhtml), this character encoding can also be named =E2=80=98US-ASCII=E2=80=99 and is= specified in RFC2046. Some excerpts: "US-ASCII" does not indicate an arbitrary 7-bit character set[sic], but specifies that all octets in the body must be interpreted as characters according to the US-ASCII character set. so it looks like, say, =C3=A9 cannot be encoded as US-ASCII, it does not belong to the character set of the encoding. More generally, anything beyond the 127 (Unicode) codepoint cannot be encoded in ANSI_X3.4-1968. Let's test this (in a new REPL with an UTF-8 locale): ((@ (ice-9 iconv) string->bytevector) "=C3=A9" "ANSI_X3.4-1968") ice-9/boot-9.scm:1669:16: In procedure raise-exception: Throw to key `encoding-error' with args `("put-char" "conversion to port en= coding failed" 84 # #\=C3=A9)'. ((@ (ice-9 iconv) string->bytevector) "=C3=A9" "ANSI_X3.4-1968" 'substitute= ) $2 =3D #vu8(63) ((@ (rnrs bytevectors) utf8->string) #vu8(63)) $3 =3D "?" and the other direction: ((@ (ice-9 iconv) bytevector->string) #vu8(128) "ANSI_X3.4-1968" 'substitut= e) $5 =3D "=EF=BF=BD" ;; why #\=EF=BF=BD and not #\?? I don't know, I guess Gu= ile is inconsistent (FWIW, I would throw an decoding-error here instead of silently corrupting = the file names.) Greetings, Maxime. --=-zcUf8ykWE3j8bVzGdQX2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlaIRhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7h9RAP0Sc0iIJeY1/HWIIAkeBn7NNTos QFDwM3HiI7FUy0l5oAD/RlA9EZ8jjTbGpl+tfqBfzLU32bIUv6d23iRBwCx9jgw= =ksO0 -----END PGP SIGNATURE----- --=-zcUf8ykWE3j8bVzGdQX2--