Richard Bucker

A new locale

Posted at — Dec 31, 2011

I cannot say that I completely understand how this works. I cannot even say that I understand even the basics. In this case, however, I managed to let my intuition guide me and I seem to have gotten to the finish line.The challenge ahead of me is that I’m getting a new warning message from mercurial when I attempt to pull the latest changesets from my repository:-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)I have 3 machines. My desktop, a development system and a mercurial repository. Let’s call them desk, dev, and repo; respectively.My .profile on my desktop had a few interesting statements:export LC_ALL=en_US.UTF-8export LANG=en_US.UTF-8And the values were brought forward to my dev machine. Assuming that term has a way to pull these values from nested terminal sessions. Then when I issue mercurial commands on the dev machine I see the warnings I mentioned earlier.I logged into all three machines and I executed the command: locale. The results on my desktop and dev were the same (en_US.UTF-8). And on the repo server it was POSIX. Well, I want to repeat that I still do not completely understand why but the following worked.Option #1: remove the two export lines from my desktop config. This was a snore and sort of expected. Since nothing was being pulled forward through the terminal sessions they each must have used their default values.Option #2: This is the option that I executed. And for no particular reason over #1. It was all intuition. On both my dev and repo systems I executed the following:localesudo dpkg-reconfigure localessudo locale-gen en_US.UTF-8And then tested the hg command again. It worked. I’m not sure what the side effects are going to be but for the time being all is well. (I remember a time when I was cut/pasting T-SQL using Microsoft’s SQL Server and whatever my code editor was at the time but I was in unicode hell.)