Closed aurelienbottazini closed 10 years ago
Why?
If you use 2.0, you get this for free, right?
It works for me when I launch irb from terminal but not from inf-ruby (ruby version 2.1.1, irb version 0.9.6). I use OS X Yosemite and Emacs 24.4.1
%w{Aurélien}
SyntaxError: (irb):5: invalid multibyte char (US-ASCII)
(irb):5: invalid multibyte char (US-ASCII)
from /usr/local/var/rbenv/versions/2.1.1/bin/irb:11:in `<main>'
In my emacs config I do try to specify utf-8 for everything
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(setq buffer-file-coding-system 'utf-8)
(setq erc-server-coding-system '(utf-8 . utf-8))
(setq locale-coding-system 'utf-8)
;; Treat clipboard input as UTF-8 string first; compound text next, etc.
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
I might be missing something in my conf though or maybe there is better way to specify utf-8 globally for ruby-mode?
That's weird. Your example works for me, and I'm still using Ruby 1.9.3 (and GNU/Linux).
I am on Mac and I have the same encoding issue when I try to evaluate org-babel block code. I am trying to figure out what is wrong with my configuration and why I need to add this to org-babel. Feel free to reject this pull request. I will try to come back when I have fully understand the issue.
Ok I found the problem. Emacs does not read correctly my env when started with a GUI on my mac and default to encoding "C". I added (setenv "LANG" "fr_FR.UTF-8")
(setenv "LC_ALL" "fr_FR.UTF-8")
and now everything works correctly. Was not related to inf-ruby. Sorry for the trouble
Thanks for the update.
I added utf-8 argument for inf-ruby-inplementations: “ruby irb”
Since utf-8 encoding is now the default with ruby 2.0 and utf-8 becoming a more and more widely adopted default. It seems a good idea to me.