I know what you are thinking: »Those poor OS X users with their mutilated unix user land. I wrote about the ancient version of
locate that OS X ships with, now this also applies to the standard shell, bash. OS X ships with version
GNU bash, version 2.05b.0(1)-release, which just like locate has poor or non UTF-8 support. If you start typing characters like ä, ü or ö you get everything but that. You can’t search for them and so on. Seriously, this is so weak but again, you can help yourself with MacPorts. I found this article on the web, describing the steps nessecary for enabling UTF-8 in Terminal.app, iTerm and X11 Term. For the sake of redundant information storage I’ll give you the management summary for Terminal.app.
- Use MacPorts to install the latest version of bash:
sudo port -c install bash(-c is for autoclean mode)
/etc/shellsand add the path to the new version of bash which is
~/.profileand add the following lines:
This adds support for german utf-8 characters. Use
locale -ato find your favorite language code.
chshand change the path of the shell to
- Open the window settings, select Display and make sure the drop-down at the bottom is set to UTF-8 and make sure Wide Glyphs are enabled too. Then click the »Use Settings as default« button.
- Restart Terminal.app – Tada.wav
- If it doesn’t work open the Terminal.app preferences and see if you manually set the shell path, if so change it to to
/opt/local/binor switch back to the default login shell
Now if you want to have UTF-8 support in locate and all the other tools as well, you have to read my previous post about findutils and coreutils.
Afterwards you are able to do things like this and feel less handicapped.
:~ $ touch äüö
:~ $ ls äüö
:~ $ rm äüö