Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12911

Re: Portable locale usage

Date 2011-09-07 20:33 +0200
From Siniša Šegvić <ssegvic@zemris.fer.hr>
Subject Re: Portable locale usage
Newsgroups comp.lang.python
Message-ID <mailman.845.1315421009.27778.python-list@python.org> (permalink)

Show all headers | View raw


> From: "Laszlo Nagy" <gandalf@shopzeus.com>
> To: "ssegvic" <sinisa.segvic@fer.hr>, python-list@python.org
> Sent: Wednesday, September 7, 2011 4:51:20 PM
> Subject: Re: Portable locale usage
> > 1. Is there a way for writing portable Python code dealing with
> > locales (as sketched in the beginning)?
> I usually do this at the top of my main program, before importing
> other modules:
> 
> import locale
> locale.setlocale(locale.LC_ALL, '')

I have set the system-wide locale to Croatian (Croatia) 
on my development system as instructed by:
http://windows.microsoft.com/en-US/windows-vista/Change-the-system-locale

Nevertheless, your proposal produces: 
('English_United States','1252')

Note that I would very much like 
to avoid changing the system locale
(this requires Administrator password and system restart).

Setting the locale for my program only would be interesting,
but AFAIK this can not be done on Windows (?).

> Why are you trying to force a specific locale to your program anyway?

Because I wish to be able to correctly sort Croatian names.

I expect that most of my Windows users will not care 
to configure their computers with the national locale 
(and besides, that does not seem to work, anyway).

Cheers,

Sinisa

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Portable locale usage Siniša Šegvić <ssegvic@zemris.fer.hr> - 2011-09-07 20:33 +0200

csiph-web