How to fix warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

I recently encountered a problem when logging through SSH in to certain servers that I use for work when using my new Macbook Pro (running Lion 10.7.3).

So right after the login was completed I was getting the following message:

warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

It only happened on certain servers, for others everything would work just fine.
This caused a few problems when running some perl scripts that would complain about the locale variables not being set, even though my Terminal app was setup correctly.

To fix this I simply added the following to my ~/.bash_profile:

export LC_CTYPE="en_US.UTF-8"

Let me know if that helped you by leaving a comment below!



44 comments to How to fix warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>