[Pythonmac-SIG] Get the locale on OSX

Nicholas Riley njriley at uiuc.edu
Mon Dec 3 08:40:56 CET 2007


On Sun, Dec 02, 2007 at 03:18:14PM +0100, Chris Van Bael wrote:
> I'm trying to port an python application which runs fine on Windows
> and Linux to OSX.
> However, it seems "lang = locale.getdefaultlocale()[0]" doesn't work.
> I've searched quite some bit on the Internet and on this mailinglist,
> and apparently it is a problem, but I haven't found any solution for
> it.

What are you trying to do with the locale information?  Leopard's
Terminal does have an option to 'set LANG environment variable on
startup', which when checked does cause locale.getdefaultlocale() to
work, but this is of no help in general.

-- 
Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>


More information about the Pythonmac-SIG mailing list