Okay, so I finally got myself a MacBook Air after 15 years of linux. And before I got it my big concern was UTF-8 support because no matter if I get files sent to me from wi
Unfortunately, the Preferences dialog is not always very helpful, but by tweaking around you should be able to get everything working.
To be able to type Swedish characters in Terminal, add the following lines to your ~/.inputrc (most likely you must create this file):
set input-meta on
set output-meta on
set convert-meta off
This should do the work both with utf8 and other codings in bash
, nano
and many other programs. Some programs, like tmux
, also depends on the locale
. Then, adding for instance export LC_ALL=en_US.UTF-8
to your ~/.profile
file should help, but keep in mind that a few (mainly obscure) programs require a standard locale, so if you have trouble running or compiling a program, try going back to LC_ALL=C
.
Some references that may be helpful:
Go to Terminal -> Preferences -> Advanced (Tab)
go down to International
and select Unicode (UTF-8)
as Character Encoding
.
And tick Set locale environment variables on startup
.
Short versatile answer (fits to other national languages, even Lithuanian or Russian)
nano .profile
or in Catalina or newer nano .zshenv
export LC_ALL=en_US.UTF-8
This solved for me even small country rare national characters. You may need to close and open Terminal to make changes effective.
Also if you like Linux behavior (use lot of Alt shortcuts like Alt+. or Alt+, in mc) then you should disable Mac style Option key function:
Terminal->Preferences->Profiles->Keyboard and check box:
Use Option as Meta key
To make nano
work as you want it to, try:
export LANG="UTF-8"
Or get a newer version of nano
via MacPorts
:
# cf. http://www.macports.org/install.php
port info nano
port variants nano
sudo port install nano +utf8 +color +no_wrap
With respect to ssh & UTF-8 issues comment out SendEnv LANG LC_*
in /etc/ssh_config
.
See: Terminal in OS X Lion: can't write åäö on remote machine
Try
.zshrc
or .bashrc
: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"
My terminal was just acting silly, not printing out åäö. I found (and set) this setting:
Under Terminal -> Preferences... -> Profiles -> Advanced
.
Seems to have fixed my problem.