## Monday, February 7, 2011

### Cygwin: Setting up the environment and locale

When using Cygwin to connect to linux servers, and when using Cygwin in a windows environment in general, it is important to get the locale right.

I am using Cywin through cmd-sessions, and I load Cygwin manually for each cmd-prompt session, as I do not want to override the Windows/Dos commands by default.
Thus I run the file loadcygwin.cmd each time I want to switch to/load Cygwin.
The content of loadcygwin.cmd is listed below:

 ```@echo off call setcygwinenvironment.cmd :: WinXp set path=c:\Program Files\CygWin\bin;%path% ::Win7 ::set path=C:\Program Files (x86)\cygwin\bin;%path% echo Cygwin now loaded. ```
 ```echo Setting up CYGWIN environment... :: Set cygwin locale to the same as windows locale. set LANG=da_DK-UTF-8 set LC_CTYPE=da_DK.UTF-8 set LC_NUMERIC=da_DK.UTF-8 set LC_TIME=da_DK.UTF-8 set LC_COLLATE=da_DK.UTF-8 set LC_MONETARY=da_DK.UTF-8 set LC_MESSAGES=da_DK.UTF-8 set LC_ALL=da_DK set CYGWIN=acl nodosfilewarning echo done. ```