From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.devel Subject: Re: environment variable don't get coding conversion Date: Sun, 26 Jan 2003 00:05:42 +0200 Organization: Mivtach-Simon Insurance agencies Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301252205.h0PM5gsx029853@beta.mvs.co.il> References: <200301170613.PAA12807@etlken.m17n.org> <200301200038.JAA16159@etlken.m17n.org> Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1043532446 9658 80.91.224.249 (25 Jan 2003 22:07:26 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 25 Jan 2003 22:07:26 +0000 (UTC) Cc: handa@m17n.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18cYST-0002Vb-00 for ; Sat, 25 Jan 2003 23:07:25 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18cYVs-00063Y-00 for ; Sat, 25 Jan 2003 23:10:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18cYSg-00041y-07 for emacs-devel@quimby.gnus.org; Sat, 25 Jan 2003 17:07:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18cYS1-0003fE-00 for emacs-devel@gnu.org; Sat, 25 Jan 2003 17:06:57 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18cYRf-0002Yz-00 for emacs-devel@gnu.org; Sat, 25 Jan 2003 17:06:43 -0500 Original-Received: from unix.sw.co.il ([192.114.178.12] helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18cYRa-0000WC-00; Sat, 25 Jan 2003 17:06:30 -0500 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.11.6/8.11.6) with ESMTP id h0PM5ih12095; Sun, 26 Jan 2003 00:05:44 +0200 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.12.5/8.12.5) with ESMTP id h0PM5hed029893; Sun, 26 Jan 2003 00:05:44 +0200 Original-Received: (from ehud@localhost) by beta.mvs.co.il (8.12.5/8.12.5/Submit) id h0PM5gsx029853; Sun, 26 Jan 2003 00:05:42 +0200 X-Authentication-Warning: beta.mvs.co.il: ehud set sender to ehud@unix.mvs.co.il using -f Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Sat, 25 Jan 2003 14:22:27 -0500) X-Mailer: Emacs 21.2.91.3 rmail (send-msg 1.108) Original-cc: d.love@dl.ac.uk Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11066 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11066 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 25 Jan 2003 14:22:27 -0500, Richard Stallman wrote: > > =22make non-ascii usable=22 is not specific enough for me to understand. > I cannot be sure if there is a real problem. I'd say =22Make non-ASCII usable=22 means that the env var should be usable in Emacs sub shell. i.e. getenv in program run in subshell will get the proper value (usually an 8 bit characters for ISO-8859-x). > Please show me a specific problem case so I can judge if there is a > significant problem. We have many variables containing Hebrew strings (ISO-8859-8). They are accessed by programs and scripts. They are represented by 8 bit values in process-environment. e.g. HUSER is set to =22=E3=E5=E4=E0=22, is stored as =22HUSER=3D\343\345\344\340=22. If I do (setenv =22HUTST=22 =22=E3=E5=E4=E0=22) it is stored as =22HUTST=3D=E3=E5=E4=E0=22. Now, when a subshell is accessing the the HUTST variable it gets =88=E3=88=E5=88=E4=88=E0 (i.e. \210 before each Hebrew character). Here is the output of =22env | grep =22^HU=22 | cat -v=22 run from Emacs: HUTST=3DM-^HM-cM-^HM-eM-^HM-dM-^HM-` HUSER=3DM-cM-eM-dM-` The way to overcome it in Emacs is to set the env var like this: (setenv =22HUTST=22 (encode-coding-string =22=E3=E5=E4=E0=22 'hebrew-iso-8bit)) > If you have a non-ASCII variable name, you can't sensibly use M-x > getenv with it; > > getenv could decode the variable name, if that is useful. You can set non-ASCII variable name, e.g. (setenv (encode-coding-string =22H=ED=F9=22 'hebrew-iso-8bit) (encode-coding-string =22=E9=F0=F8=F7=22 'hebrew-iso-8bit)) and you can use them in subprocesses. To use them in Emacs itself, You have to use the encoded Hebrew name, i.e. (getenv (encode-coding-string =22H=ED=F9=22 'hebrew-iso-8bit)) I agree that to use non-ASCII environment variable name is not practical, so this problem is not really important, but the non-ASCII values are used a lot, and the practical way for ISO-8859-x is to have them in unibyte. The `process-environment' can hold the values in multibyte but `child_setup' and `getenv_internal' (in callproc.c) should transform the values to unibyte (or whatever necessary for other coding systems like CJK and utf-8). Ehud. - -- Ehud Karni Tel: +972-3-7966-561 /=22\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ mailto:ehud@unix.mvs.co.il Better Safe Than Sorry -----BEGIN PGP SIGNATURE----- Comment: use http://www.keyserver.net/ to get my key (and others) iD8DBQE+Mwo2LFvTvpjqOY0RAu3ZAJ4rS0k9OUjuWnrmmCMLyQz73uQurgCdG5n+ KAZmF3+IUi+jSO8yHWUUEyo=3D =3DTPq/ -----END PGP SIGNATURE-----