unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Setting file-name/process coding system from LANG
@ 2004-10-13  8:44 Miles Bader
  2004-10-15  0:25 ` Richard Stallman
  0 siblings, 1 reply; 17+ messages in thread
From: Miles Bader @ 2004-10-13  8:44 UTC (permalink / raw)


I use "Japanese" language environment, and my LANG environment variable is
set to "ja_JP.UTF-8".

It seems to me that LANG should be enough to force filenames and process
I/O coding to use utf-8, regardless of the Emacs language-environment
setting -- after all, the language-environment is more of a broad hint how
to operate, whereas LANG can say specifically what coding system to use,
and will cause subprocesses to do their I/O in that coding system -- but
this doesn't seem to happen.

If I start emacs with -q, it will set things up correctly from LANG (so
for instance, starting a shell and do a ls will show utf-8 encoded
filenames correctly).

However, as soon as I do `M-x set-language-environment RET Japanese RET',
then default-file-name-coding-system gets set to `japanese-iso-8bit', and
the default coding system for process I/O is also `japanese-iso-8bit',
which is wrong.

I use the following code in my .emacs:

   (when (and (getenv "LANG") (string-match "\\<utf-8$" (getenv "LANG")))
     (setq file-name-coding-system 'utf-8)
     (setq process-coding-system-alist '(("" . utf-8-unix))))

which forces them to use utf-8 instead, and this works, but I'd think
this shouldn't be necessary if I have LANG set.

[Note I'm currently using Emacs 22 (unicode branch), but the same thing
happens with CVS trunk Emacs.]

Thanks,

-Miles
-- 
A zen-buddhist walked into a pizza shop and
said, "Make me one with everything."

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2004-10-25 13:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-13  8:44 Setting file-name/process coding system from LANG Miles Bader
2004-10-15  0:25 ` Richard Stallman
2004-10-15  0:51   ` Miles Bader
2004-10-16 13:53     ` Richard Stallman
2004-10-17  0:14       ` Miles Bader
2004-10-25 13:13         ` Richard Stallman
2004-10-18 13:04       ` Kenichi Handa
2004-10-19  6:13         ` Richard Stallman
2004-10-19 13:13           ` Kenichi Handa
2004-10-19 13:51             ` Stefan Monnier
2004-10-20  6:02               ` Kenichi Handa
2004-10-20 10:34               ` Richard Stallman
2004-10-19 21:51             ` Miles Bader
2004-10-20  6:21               ` Kenichi Handa
2004-10-20  8:50                 ` Miles Bader
2004-10-20 13:02                   ` Stefan Monnier
2004-10-20 10:34             ` Richard Stallman

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).