[freetds] Setting correct Charset on Mac os X

Olivier Amblet olivier at miettes.ch
Thu Oct 25 06:21:32 EDT 2007


Hi,

I would like to give a small follow up on this entry which greatly  
help me to solve my locale charset problem on mac os x freetds install.

original mail : http://lists.ibiblio.org/pipermail/freetds/ 
2007q3/022379.html

* The command 'locale' returns the display locale settings of your  
system.

 >$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL="C"

'C' is the default posix encoding. To display a complete list of  
available charset use locale -a
 >$ locale -a
af_ZA
af_ZA.ISO8859-1
af_ZA.ISO8859-15
af_ZA.UTF-8
am_ET
am_ET.UTF-8
...

Now, just set your LC_ALL env to any of those variables.

 >$ export LC_ALL=fr_CH.ISO8859-1
or
 >$ export LC_ALL=en_GB.UTF-8

And you should obtains :
 >$ locale
LANG=
LC_COLLATE="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"

If you don't obtain such a display. double check the spelling of your  
encoding string.
Put the export command into your .profile if you want.

Please refer to :
* http://lists.ibiblio.org/pipermail/freetds/2007q3/022379.html
* http://developer.apple.com/documentation/Darwin/Reference/ManPages/ 
man3/nl_langinfo.3.html
* man locale

Hope this will help someone ;-)

Olivier


More information about the FreeTDS mailing list