help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Encoding error when calling a ruby script from Emacs using shell-com


From: Marcelo de Moraes Serpa
Subject: Re: Encoding error when calling a ruby script from Emacs using shell-command
Date: Fri, 31 Aug 2012 17:18:15 -0500

Alright, I solved it.

The problem is that emacs' shell-command doesn't use the same environment, so it wasn't picking up the value of those three vars:

✗ export | grep UTF
    LANG=en_US.UTF-8 
    LC_ALL=en_US.UTF-8
    LC_CTYPE=en_US.UTF-8

So, I did this:

(defun test ()
  (setenv "LANG" "en_US.UTF-8")
  (setenv "LC_ALL" "en_US.UTF-8")
  (setenv "LC_CTYPE" "en_US.UTF-8")
        (shell-command  "/Users/myself/.rvm/bin/rvm ruby-1.9.3-p194 do /usr/bin/rubyscript")
        )

And now it works fine.

Cheers,

- Marcelo.

On Thu, Aug 30, 2012 at 6:01 PM, Marcelo de Moraes Serpa <celoserpa@gmail.com> wrote:
Hi Peter,

Thanks for the reply.

I've changed the func argument to 'utf-8-unix and it did not make a difference. Same error.

- Marcelo.


On Thu, Aug 30, 2012 at 4:16 PM, Peter Dyballa <Peter_Dyballa@web.de> wrote:

Am 30.08.2012 um 19:41 schrieb Marcelo de Moraes Serpa:

> By the way, I forgot to say that I have added the "(let
> (universal-coding-system-argument 'us-ascii-mac))" in an attempt to fix it,
> but it made no difference whatsoever.

Have you tried an UTF encoding? I think Ruby isn't as primitive as US-ASCII…

--
Greetings

  Pete

We are usually convinced more easily by reasons we have found ourselves than by those which have occurred to others.
                                – Blaise Pascal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]