If it happens when using SSH, this is a fault on the SSH client, not the RPi. For example using an Ubuntu machine as the SSH client will cause this problem.
To fix this SSH problem, edit the file /etc/ssh/ssh_config on the SSH client (not the RPi) and remove the line
SendEnv LANG LC_*
This stops the client sending invalid locale information to the RPi.
MAC下的ssh_config路径为 /etc/ssh_config,将SendEnv LANG LC_*这一行注释掉即可
From: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=50&t=11870