From: "Ehud Karni" <ehud@unix.mvs.co.il>
Cc: handa@m17n.org
Subject: Re: environment variable don't get coding conversion
Date: Sun, 26 Jan 2003 00:05:42 +0200 [thread overview]
Message-ID: <200301252205.h0PM5gsx029853@beta.mvs.co.il> (raw)
In-Reply-To: <E18cVsp-0002b2-00@fencepost.gnu.org> (message from Richard Stallman on Sat, 25 Jan 2003 14:22:27 -0500)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sat, 25 Jan 2003 14:22:27 -0500, Richard Stallman <rms@gnu.org> wrote:
>
> "make non-ascii usable" is not specific enough for me to understand.
> I cannot be sure if there is a real problem.
I'd say "Make non-ASCII usable" 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 "דוהא", is stored as "HUSER=\343\345\344\340".
If I do (setenv "HUTST" "דוהא") it is stored as "HUTST=דוהא". Now,
when a subshell is accessing the the HUTST variable it gets
דוהא (i.e. \210 before each Hebrew character).
Here is the output of "env | grep "^HU" | cat -v" run from Emacs:
HUTST=M-^HM-cM-^HM-eM-^HM-dM-^HM-`
HUSER=M-cM-eM-dM-`
The way to overcome it in Emacs is to set the env var like this:
(setenv "HUTST" (encode-coding-string "דוהא" '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 "Hםש" 'hebrew-iso-8bit)
(encode-coding-string "ינרק" '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 "Hםש" '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 /"\
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=
=TPq/
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2003-01-25 22:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <rzqadi1i9ka.fsf@albion.dl.ac.uk>
[not found] ` <200301170613.PAA12807@etlken.m17n.org>
2003-01-18 0:46 ` environment variable don't get coding conversion Richard Stallman
2003-01-20 0:38 ` Kenichi Handa
2003-01-20 16:46 ` Richard Stallman
2003-01-21 18:21 ` Dave Love
2003-01-23 7:59 ` Richard Stallman
2003-01-23 23:04 ` Dave Love
2003-01-25 19:22 ` Richard Stallman
2003-01-25 22:05 ` Ehud Karni [this message]
2003-01-26 14:41 ` Kai Großjohann
2003-01-26 16:11 ` Eli Zaretskii
2003-01-27 13:18 ` Stefan Monnier
2003-01-27 2:48 ` Kenichi Handa
2003-01-26 18:50 ` Dave Love
2003-01-27 2:31 ` Richard Stallman
2003-01-28 18:42 ` Dave Love
2003-01-26 18:22 ` Dave Love
2003-01-21 18:18 ` Dave Love
2003-01-23 8:00 ` Richard Stallman
2003-01-25 0:56 ` Kenichi Handa
2003-01-25 17:09 ` Eli Zaretskii
2003-01-26 15:36 ` Richard Stallman
2003-01-26 16:08 ` Eli Zaretskii
2003-01-27 17:41 ` Richard Stallman
2003-01-27 2:27 ` Kenichi Handa
2003-01-26 18:23 ` Dave Love
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200301252205.h0PM5gsx029853@beta.mvs.co.il \
--to=ehud@unix.mvs.co.il \
--cc=handa@m17n.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).