Enable International Characters in OS X SSH

By default, when you ssh into OS X, it will not show international characters correctly but a bunch of question marks. According to here, the problem seems to be that sshd does not accept environment variables about client language settings; the Mac ssh client does not send those variables either.

To fix this, edit the file /etc/sshd_config and add the following line to make sshd (server) accept language-related environment variables.

# Accept language environment variables
AcceptEnv LANG LC_*

And edit the file /etc/ssh_config and add the following line to make ssh (client) to send those variables.

# Send language environment variables
SendEnv LANG LC_*

Actually you should add both since each machine might be a client and a server simultaneously. To ease the pain, just download this script and save it in your Home folder with the name ssh-char.sh. Then fire up a Terminal window and type:

sudo bash ssh-char.sh

You should run the script on every Mac you want to have international characters enabled.