CYGWIN locale problem

3

I have the following cygwin installation:

CYGWIN_NT-6.1-WOW64. 

When I launch it, I have this message:

bash: warning: setlocale: LC_COLLATE: cannot change locale (FR)

I'm using Windows 7 64 bit.

Any ideas?

fego

Posted 2011-04-15T15:48:14.490

Reputation: 33

Answers

4

FR is not a valid Cygwin locale. It should be something like fr_FR, fr_FR.UTF-8, or the default C.UTF-8. Check the setting of the LANG environment variable (or possibly LC_COLLATE or LC_ALL). If you didn't set it to FR, chances are that some other software set it in the Windows environment. MS's "Subsystem for Unix-based Applications" perhaps?

Windows-wide environment variables can be changed via the Advanced tab of the System Properties control panel. If you don't want to do that, and if you're using Cygwin's default console, you could set LANG in C:\cygwin\cygwin.bat. If you're using the mintty terminal, you can set the locale on the Text page of its options. (Note that setting the locale in ~/.profile or one of the other bash startup files would be too late for bash itself.)

ak2

Posted 2011-04-15T15:48:14.490

Reputation: 3 387

1Thks ! I put SET LANG=fr_FR.UTF-8 in the file Cygwin.bat and it works now :) – fego – 2011-04-18T10:30:01.993

You're welcome. Any idea where the LANG=FR setting came from? That might be helpful for others encountering the same issue. – ak2 – 2011-04-18T11:39:41.920

No idea yet. It was strange because if I started Cygwin after the startup of windows it was ok, but if I left Cygwin and started it again the problem appeared. – fego – 2011-04-18T19:35:51.720