Script/console UTF-8 MacOS X?

Is it possible to use foreign characters with UTF-8 encoding in the
console on MacOS X? I found a few OLD tutorials on the Internet and
none of them seemed to work. I’m using Leopard by the way. When I try
to paste in Chinese characters from AltaVista Babel Fish it just
starts beeping and nothing happens.

On 5/9/08, Stedwick [email protected] wrote:

Is it possible to use foreign characters with UTF-8 encoding in the
console on MacOS X? I found a few OLD tutorials on the Internet and
none of them seemed to work. I’m using Leopard by the way. When I try
to paste in Chinese characters from AltaVista Babel Fish it just
starts beeping and nothing happens.

How is your question related to Ruby on Rails? What’s foreign
caracters? English is very foreign to me. Also, please specify your
current settings of Terminal and what exactly you tried to paste.

I’m using the Ruby on rails plug-in called globalize. It works great
so far through the browser, but I would like to be able to mess with
it using the script/console command.

I went to AltaVista Babel Fish and translated some English text into
simplified Chinese. When I paste that into the MacOS X terminal it
works fine, but only in the bash shell not in the script/console. When
I try to paste simplified Chinese characters into the script/console
it just beeps and does nothing.

Chinese characters work fine when submitted using a form in a browser
(again translated with Babel Fish), so I know that globalize is
working, but I would like to be able to mess with it using the script/
console.

The $KCODE is set to UTF-8 and the MacOS X terminal preferences are
set to UTF-8 and the “escape non-ASCII characters” checkbox is NOT
checked. Again, pasting Chinese into the terminal works fine, it just
doesn’t work when script/console is running.

It’s not the end of the world of course, but I would appreciate any
ideas that you have :slight_smile:

On May 11, 6:07 pm, Stedwick [email protected] wrote:

The $KCODE is set to UTF-8 and the MacOS X terminal preferences are
set to UTF-8 and the “escape non-ASCII characters” checkbox is NOT
checked. Again, pasting Chinese into the terminal works fine, it just
doesn’t work when script/console is running.

It’s not the end of the world of course, but I would appreciate any
ideas that you have :slight_smile:

Try creating a UTF-8 file and piping it to script/console, instead of
manually interacting. This can help you determine if it’s a script/
console internal problem, or your terminal and script/console not
playing nicely.

See this discussion for a possible remedy:

< No unicode in rails console - Rails I18n - Ruby-Forum>

It’s a Ruby readline library problem…

izidor