1

I have a problem with non-ASCII characters in the Terminal on Mac. If I write:

echo ÆØÅ

Then press Enter, Arrow Up, Arrow Left, so the cursor is between the Ø and the Å, then write X, then the Å is converted to ?, and if I press Enter, the following is echoed:

ÆØ?X?

Pressing Ctrl+A and Ctrl+E with non-ASCII characters entered also causes a mess.

My settings are as follows:

~/.profile:
export LC_ALL="nb_NO.UTF-8"

~/.inputrc:
set input-meta on
set output-meta on
set convert-meta off

Terminal > Settings > Advanced > Declare terminal as: xterm

Unsetting LC_ALL has no effect. Changing the .inputrc settings just seems to make things worse.

I really hope someone has the answer to this.

3
  • 1
    What version of bash? Older versions of bash didn't support editing UTF8 text very well Commented Aug 6, 2013 at 9:00
  • Are you sure nb_NO.UTF-8 is a valid locale name on your system? Does it show up in the output of locale -a? What does locale charmap tell you? Commented Aug 6, 2013 at 9:03
  • Could you post that as an answer so the question can be marked as answered please? Commented Aug 6, 2013 at 13:11

1 Answer 1

2

nb_NO.UTF-8 did indeed not exist. Changing to no_NO.UTF-8 solved the problem. Actually, the problem was introduced by LANG=C which was set for some other reason. Removing this makes OS X set LC_CTYPE=UTF-8 by default, which works out of the box.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.