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


Groups > comp.lang.python > #12911

Re: Portable locale usage

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ssegvic@zemris.fer.hr>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.038
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'anyway).': 0.07; 'names.': 0.07; 'python': 0.08; 'locale': 0.09; 'configure': 0.10; 'wednesday,': 0.15; "'')": 0.16; '(?).': 0.16; 'subject:usage': 0.16; 'cc:addr:python-list': 0.16; 'cheers,': 0.18; 'cc:no real name:2**0': 0.20; 'trying': 0.21; 'cc:2**0': 0.22; 'header:In- Reply-To:1': 0.22; 'work,': 0.23; 'skip:l 30': 0.24; 'expect': 0.25; 'code': 0.25; 'windows': 0.26; '(this': 0.28; 'import': 0.28; 'importing': 0.29; '(and': 0.29; 'cc:addr:python.org': 0.30; 'seem': 0.31; 'changing': 0.31; 'does': 0.32; 'subject:': 0.32; 'usually': 0.32; 'sort': 0.33; 'there': 0.33; 'sent:': 0.33; 'done': 0.34; '(as': 0.34; 'force': 0.34; 'setting': 0.34; 'url:windows': 0.36; 'but': 0.37; 'from:': 0.38; 'program,': 0.38; 'subject:: ': 0.39; 'correctly': 0.39; 'why': 0.39; 'url:microsoft': 0.40; 'your': 0.61; 'national': 0.63; 'computers': 0.64; 'proposal': 0.67; 'url:en-us': 0.68; 'dealing': 0.69; 'wish': 0.69; 'care': 0.71; 'instructed': 0.77; 'interesting,': 0.84; 'received:hr': 0.84; 'besides,': 0.93
X-Virus-Scanned amavisd-new at zemris.fer.hr
Date Wed, 7 Sep 2011 20:33:57 +0200 (CEST)
From Siniša Šegvić <ssegvic@zemris.fer.hr>
To Laszlo Nagy <gandalf@shopzeus.com>
In-Reply-To <4E6784E8.2040206@shopzeus.com>
Subject Re: Portable locale usage
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Originating-IP [161.53.65.130]
X-Mailer Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Linux)/6.0.10_GA_2692)
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.845.1315421009.27778.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1315421009 news.xs4all.nl 2470 [2001:888:2000:d::a6]:34702
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:12911

Show key headers only | 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