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.

  • 1
    What version of bash? Older versions of bash didn't support editing UTF8 text very well – Stéphane Chazelas Aug 6 '13 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? – Stéphane Chazelas Aug 6 '13 at 9:03
  • Could you post that as an answer so the question can be marked as answered please? – terdon Aug 6 '13 at 13:11
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.