all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* UTF-8-encoded output in Emacs shell
@ 2010-01-25 15:09 kj
  2010-01-25 15:13 ` kj
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kj @ 2010-01-25 15:09 UTC (permalink / raw)
  To: help-gnu-emacs



I have a Python script that writes UTF-8-encoded Japanese text to
stdout.  This script produces nice-looking Japanese output when I
run it on my regular shell, running on OS X's Terminal utility.
But if I start "emacs -nw" the same Terminal window, then from
within the Emacs session I start a new shell (with M-x shell), and
now run the script within this Emacs-internal shell, the output
looks like garbage.  ("Gobbledygook" is the technical term for
this, I think.)

What must I do to get the right-looking Japanese output when I run
this script within Emacs?

(BTW, I naively tried setting the coding for the *shell* buffer to
utf-8, with M-x set-buffer-file-coding-system, but this had no
effect.  But, from Tomas's reply to an earlier query of mine, this
maneuver may not be enough in any case, or may be meaningless in
a buffer like *shell* that is not associated to a file.)

TIA!

~K


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

* Re: UTF-8-encoded output in Emacs shell
  2010-01-25 15:09 UTF-8-encoded output in Emacs shell kj
@ 2010-01-25 15:13 ` kj
  2010-01-25 15:17 ` kj
  2010-01-25 22:45 ` Tim X
  2 siblings, 0 replies; 4+ messages in thread
From: kj @ 2010-01-25 15:13 UTC (permalink / raw)
  To: help-gnu-emacs

In <hjkc71$fco$1@reader1.panix.com> kj <no.email@please.post> writes:

>I have a Python script that writes UTF-8-encoded Japanese text to
>stdout.  This script produces nice-looking Japanese output when I
>run it on my regular shell, running on OS X's Terminal utility.
>But if I start "emacs -nw" the same Terminal window, then from
>within the Emacs session I start a new shell (with M-x shell), and
>now run the script within this Emacs-internal shell, the output
>looks like garbage.  ("Gobbledygook" is the technical term for
>this, I think.)

>What must I do to get the right-looking Japanese output when I run
>this script within Emacs?

>(BTW, I naively tried setting the coding for the *shell* buffer to
>utf-8, with M-x set-buffer-file-coding-system, but this had no
>effect.  But, from Tomas's reply to an earlier query of mine, this
>maneuver may not be enough in any case, or may be meaningless in
>a buffer like *shell* that is not associated to a file.)

>TIA!

>~K


I forgot to mention, FWIW, that in the shell running inside Emacs,
my TERM environment variable is set to "emacs", whereas in my
Terminal shell this variable is set to "xterm-color".

~K



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

* Re: UTF-8-encoded output in Emacs shell
  2010-01-25 15:09 UTF-8-encoded output in Emacs shell kj
  2010-01-25 15:13 ` kj
@ 2010-01-25 15:17 ` kj
  2010-01-25 22:45 ` Tim X
  2 siblings, 0 replies; 4+ messages in thread
From: kj @ 2010-01-25 15:17 UTC (permalink / raw)
  To: help-gnu-emacs

In <hjkc71$fco$1@reader1.panix.com> kj <no.email@please.post> writes:

>(BTW, I naively tried setting the coding for the *shell* buffer to
>utf-8, with M-x set-buffer-file-coding-system, but this had no
>effect.  But, from Tomas's reply to an earlier query of mine, this
>maneuver may not be enough in any case, or may be meaningless in
>a buffer like *shell* that is not associated to a file.)

OK, I was getting warm I guess.  I found that for *shell* I need
to use set-buffer-process-coding-system.  I'm all set now.  Please
disregard my original post.  :)

~K


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

* Re: UTF-8-encoded output in Emacs shell
  2010-01-25 15:09 UTF-8-encoded output in Emacs shell kj
  2010-01-25 15:13 ` kj
  2010-01-25 15:17 ` kj
@ 2010-01-25 22:45 ` Tim X
  2 siblings, 0 replies; 4+ messages in thread
From: Tim X @ 2010-01-25 22:45 UTC (permalink / raw)
  To: help-gnu-emacs

kj <no.email@please.post> writes:

> I have a Python script that writes UTF-8-encoded Japanese text to
> stdout.  This script produces nice-looking Japanese output when I
> run it on my regular shell, running on OS X's Terminal utility.
> But if I start "emacs -nw" the same Terminal window, then from
> within the Emacs session I start a new shell (with M-x shell), and
> now run the script within this Emacs-internal shell, the output
> looks like garbage.  ("Gobbledygook" is the technical term for
> this, I think.)
>
> What must I do to get the right-looking Japanese output when I run
> this script within Emacs?
>
> (BTW, I naively tried setting the coding for the *shell* buffer to
> utf-8, with M-x set-buffer-file-coding-system, but this had no
> effect.  But, from Tomas's reply to an earlier query of mine, this
> maneuver may not be enough in any case, or may be meaningless in
> a buffer like *shell* that is not associated to a file.)
>
> TIA!
>
What version of emacs?

What is the value of  LANG and LC_* variables inside the emacs shell and
outside of emacs in the terminal?

Tim


-- 
tcross (at) rapttech dot com dot au


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

end of thread, other threads:[~2010-01-25 22:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-25 15:09 UTF-8-encoded output in Emacs shell kj
2010-01-25 15:13 ` kj
2010-01-25 15:17 ` kj
2010-01-25 22:45 ` Tim X

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.