No unicode in rails console

I’m unable to enter characters like é (in Café) into script/console but
they work just fine in the regular terminal. I can’t seem to find
anyone ever having an issue with this out there.

I’d be so grateful for any ideas.

in config/environment.rb

ENV[‘LANG’] # => ‘en_US.UTF-8’
ENV[‘LC_CTYPE’] # => ‘en_US.UTF-8’

from terminal:

locale

LANG=“en_US.UTF-8”
LC_COLLATE=“en_US.UTF-8”
LC_CTYPE=“en_US.UTF-8”
LC_MESSAGES=“en_US.UTF-8”
LC_MONETARY=“en_US.UTF-8”
LC_NUMERIC=“en_US.UTF-8”
LC_TIME=“en_US.UTF-8”
LC_ALL=“en_US.UTF-8”

System config:
Rails 2.0.2
Ruby 1.8
Mac OS X Leopard

Regards,
Brad

Just to confirm - I could not enter anything outside ASCII either. It
seems that the irb (which is used by script/console) input code is a
bit dumb…

I forgot exact solution but I thing I did something like simple
redirection with pipe ‘cat | irb’ or ‘cat | script/console’ and I
could enter the characters…

izidor

Izidor J. wrote:

Just to confirm - I could not enter anything outside ASCII either. It
seems that the irb (which is used by script/console) input code is a
bit dumb…

I forgot exact solution but I thing I did something like simple
redirection with pipe ‘cat | irb’ or ‘cat | script/console’ and I
could enter the characters…

izidor

Interesting. I was eventually able to get it working by following these
steps: Macworld - News, Tips & Reviews from the Apple Experts

Hopefully this will help someone in a similar situation. Thank you for
responding.

Brad

On Wed, Feb 13, 2008 at 4:32 AM, Brad C. [email protected]
wrote:

I’m unable to enter characters like é (in Café) into script/console but
they work just fine in the regular terminal. I can’t seem to find
anyone ever having an issue with this out there.

The input is not related to rails but to your terminal itself. Make
sure you also set “Unicode” in Preferences > Settings > Advanced tab >
International.

Hoping it will fix your issue.

Brad C. wrote:

I’m unable to enter characters like é (in Café) into script/console but
they work just fine in the regular terminal. I can’t seem to find
anyone ever having an issue with this out there.

Would this help? - http://henrik.nyh.se/2008/03/irb-readline

According to the blog author, “The irb (Interactive Ruby) that ships
with OS X Leopard does not have readline support… More importantly to
me, you can’t use non-ASCII characters like Swedish ‘Ã¥’, ‘ä’ and ‘ö’.”

I haven’t tried his solution yet, but I think this is what you (and I)
are probably looking for (since I’m unable to type Japanese words into
irb).

Brad C. wrote:

Izidor J. wrote:

Just to confirm - I could not enter anything outside ASCII either. It
seems that the irb (which is used by script/console) input code is a
bit dumb…

I forgot exact solution but I thing I did something like simple
redirection with pipe ‘cat | irb’ or ‘cat | script/console’ and I
could enter the characters…

izidor

Interesting. I was eventually able to get it working by following these
steps: Macworld - News, Tips & Reviews from the Apple Experts

Hopefully this will help someone in a similar situation. Thank you for
responding.

Brad

I have the same problem and followed the steps at macosxhints regarding
.profile, .inputrc, and .MacOSX/environment.plist, but it still doesn’t
work. I’m using Leopard 10.5.2, Ruby 1.8.6., Rails 2.0.2.