Fixing the error “warning: setlocale: LC_CTYPE: cannot change locale”

Recently I was granted build server access on Goo. While trying Bash completion, I encountered this error. Every time I tried to use Tab key for completion, this error message would get added to my typed command. It didnt interfere with the actual command execution. Bash seemed to be totally oblivious to the command line getting hijacked in this fashion. But for the user, me, it was an eyesore.

The fix was too simple. I simply needed to add the following to my ~/.bashrc file:

export LC_CTYPE="en_US.UTF-8"

Thanks to bergspot

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.