From: Marcelo de Moraes Serpa <celoserpa@gmail.com>
To: Peter Dyballa <Peter_Dyballa@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Encoding error when calling a ruby script from Emacs using shell-command
Date: Fri, 31 Aug 2012 17:18:15 -0500 [thread overview]
Message-ID: <CACHMzOGaX=h_HhQiETNuvZ56ctsJd3JRKHocEs+WU+2mCP3Vwg@mail.gmail.com> (raw)
In-Reply-To: <CACHMzOExwPP6FExn035hFs7_F4yrAkGUyUj+pKHiOSWqZcgFGg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
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
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 3209 bytes --]
next prev parent reply other threads:[~2012-08-31 22:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 17:40 Encoding error when calling a ruby script from Emacs using shell-command Marcelo de Moraes Serpa
2012-08-30 17:41 ` Marcelo de Moraes Serpa
2012-08-30 21:16 ` Peter Dyballa
2012-08-30 23:01 ` Marcelo de Moraes Serpa
2012-08-31 22:18 ` Marcelo de Moraes Serpa [this message]
2012-08-31 22:40 ` Peter Dyballa
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACHMzOGaX=h_HhQiETNuvZ56ctsJd3JRKHocEs+WU+2mCP3Vwg@mail.gmail.com' \
--to=celoserpa@gmail.com \
--cc=Peter_Dyballa@web.de \
--cc=help-gnu-emacs@gnu.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 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.