From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.devel Subject: Re: Improving the handling of system data (env, users, paths, ...) Date: Sun, 07 Jul 2024 11:45:59 +0200 Message-ID: <1058bc6ec96dfe613eb6f5879cea585213f9d243.camel@abou-samra.fr> References: <878qyeqn1q.fsf@trouble.defaultvalue.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-cuyZDY6eCKMg8+pmD2Pi" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39225"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.52.2 (3.52.2-1.fc40) To: Rob Browning , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Jul 07 11:46:36 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sQOTb-0009yq-A9 for guile-devel@m.gmane-mx.org; Sun, 07 Jul 2024 11:46:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQOTF-0007aQ-Gc; Sun, 07 Jul 2024 05:46:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQOTC-0007aC-T6 for guile-devel@gnu.org; Sun, 07 Jul 2024 05:46:11 -0400 Original-Received: from mout.kundenserver.de ([212.227.17.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQOTA-0002NB-MQ for guile-devel@gnu.org; Sun, 07 Jul 2024 05:46:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=abou-samra.fr; s=s1-ionos; t=1720345560; x=1720950360; i=jean@abou-samra.fr; bh=B9L83H3epYodDxBn3QgaIZMQOQtkxV7F5hY5w0kL/J4=; h=X-UI-Sender-Class:Message-ID:Subject:From:To:Date:In-Reply-To: References:Content-Type:MIME-Version:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=FDlw7Qb9brCj1dAJbfmreAv9RnRm0hxAxyc36iGFmtJgSYE2MCKD/J8Tzi4AlbYi zAy7rWX+IBbW7hqdGrGnZdmum0iToRs++geiW+leu2D2W3B3o/88XixJjdAyXijVf qv01fTVdmuqnGOI9/J6n8bQjr3qVSHeSg2dAD6K1noEh9ZVXgIHCIFKINBtqbewnn vRenduVy9RAvOr5k5Eeh/fHQpvfUkcQ5cpP5ybZR0GF94T1zvALSzxncfzn/TR/Cp YJzwtb/PQi/gE0Dz9GBEtxAstAKOvw3vuvUpisUSMkM3+l/FN1se7/lVLmy0+pXZ3 hqUSfYYvttoVl8d0Ew== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Original-Received: from laptop.home ([90.60.20.191]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.119]) with ESMTPSA (Nemesis) id 1M9WBG-1sVum42HSO-00HJ9m; Sun, 07 Jul 2024 11:46:00 +0200 In-Reply-To: <878qyeqn1q.fsf@trouble.defaultvalue.org> X-Provags-ID: V03:K1:NA72NItyCEEPzIM2IzDPeqybllQWR8zFGzl7wTvI+GO7+iuYOqB remFqT95TlP4CWuWK/2XE+2RLxpWB3n62UVMG8KDBFDXCW63IxjkongePnWY9FoEm7zQHEG 5SEZdeV//g/sykMIbVUnT2chwp9VukrocRUiBC3vqUdbyvSmpwM/Q1j3w/k637u+prp9exi jGlDKXYqvvIO1EgtsgLHA== UI-OutboundReport: notjunk:1;M01:P0:f9RLBHZ2cI4=;HRKLBqQpsdHp3w3UwSjuDTXbbXd pGAnHGDiyMaQNc6vRiELV+U4spX3rXe6sTJGXtEPHBOyZ1MI2tnOTaqATrxKD1SXJuZosbB8J 5IOEpJrTJ5l/s8YUDRvNGh1K/YdQKz6D2mifwgk2G30T1hY93u3WazQZJ8l3Qt1u/wVJSdjzD biBXhTLBZjC4ARHZxt3KgsIaOQy8Nivwlf8ikVJSbS9bpR2/G7Xbi+S3sZOP/IpmRePeYFjHv 1dzBPJuPaPho7IU6euQQ2c6DUruVFIkQfUoE99dgXvQK0ilAx9mPwenT0Um9nIW9nqVsoGB65 EmThQVvgBlKolyCEFKGEAAHnszegKLLMJGoj9ncxj0CYRayniF+sFX7sibZVxym7vkPB4rSou e1gvHSwcV9erYL3VPCFF9KDGGw041PrnB83U59ilF1oJ22txDq5KDRrieucBxyKvy0Yp118wK BXlqvYsTO3+ibpP0vTXY2DljG9xTYBl/j4PB/c7CFHjQdPN1prD17IwdkKBEVlyLCjU3dfVMB 9CKat2nsAsApjGiqS2w+3ayvajvvfa2/NcPXTISHaWmTbWVS3EUambtzqlP/QgoHxSsmZdoVf IZ/slRwZjlAZ1ejyv3pY6lf2XUHwB5+5k3V8Y02Fu7ySztIclYVMP9R+NIGogGq7N5vLP19en VdCJGILkyVD2scew1ztLFtb/ZxH8XXvVmi/fzM7ObfoQ4Vuh4lbbleaEDlo0l//rw26VZec6A 0LYsWLwhrvmvJpTJlGcWAwQYXto18QQlF2CDsxEmWE+QaTMNdyG5zs= Received-SPF: pass client-ip=212.227.17.10; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22551 Archived-At: --=-cuyZDY6eCKMg8+pmD2Pi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le samedi 06 juillet 2024 =C3=A0 15:32 -0500, Rob Browning a =C3=A9crit=C2= =A0: > At a minimum, I suggest Guile should produce an error by default > (instead of generating incorrect data) when the system bytes cannot be > encoded in the current locale. I agree that an error would be better than replacing with a question mark. > As an incremental step, and as has been discussed elsewhere a bit, we > might add support for uselocale()[2] and then document that the current > recommendation is to always use ISO-8859-1 (i.e. Latin-1)[3] for system > data unless you're certain your program doesn't need to be general > purpose (perhaps you're sure you only care about UTF-8 systems). latin1 locale is a terrible default. Virtually no Linux system these days has a locale encoding different than UTF-8. Except perhaps for the "C" loca= le, which people still use by habit with "LC_ALL=3DC" as a way to say "speak En= glish please", although most Linux distros have a C.UTF-8 locale these days. > The most direct (and compact, if we do convert to UTF-8) representation > would bytevectors, but then you would have a much more limited set of > operations available (i.e. strings have all of srfi-13, srfi-14, etc.) > unless we expanded them (likely re-using the existing code paths).=C2=A0 = Of > course you could still convert to Latin-1, perform the operation, and > convert back, but that's not ideal. Why is that "not ideal"? The (ice-9 iconv) API is convenient, locale-indepe= ndent and thread-safe. --=-cuyZDY6eCKMg8+pmD2Pi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZopj1wAKCRCj8PYLiTOX /oSkAP9oJGHYXGA9Moiur5Cll+EXAaKcO2yzKT7TvStiu7/ISAD/ZD3l79bmV0Ic OyNsuNjKBmKDFiFg+4LbLjnKpqmVjwk= =6Lib -----END PGP SIGNATURE----- --=-cuyZDY6eCKMg8+pmD2Pi--