[Tutor] Comma Chameleon?
dman
dman@dman.ddts.net
Tue, 26 Mar 2002 09:02:18 -0600
On Tue, Mar 26, 2002 at 08:43:04AM -0500, Lloyd Kvam wrote:
| PythonWin 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32.
| Portions Copyright 1994-2000 Mark Hammond (MarkH@ActiveState.com) - see
| 'Help/About PythonWin' for further copyright information.
|
| >>> import locale
| >>> locale.setlocale(locale.LC_ALL, 'US')
| 'English_United States.1252'
^^^^
| >>> print locale.format('%s','123456789',1)
| 123,456,789
|
| Actually, it may be a python version issue!
Or an OS issue -- CP1252 is a Microsoft/Windows thing. That long name
is also non-standard. The ISO spec follows this format : The language
has a two (lowercase) character code. It is optionally followed by an
underscore and a 2-(uppercase)-character country code. That is
optionally followed by a dot and a charset specification. Thus en
en_US, en_UK, en_US.ISO8859-1 and en_US.UTF-8 are all valid (ISO)
locale specifications.
Do you know how annoying it is to receive emails where quotes appear
as superscript '2' and '3' or where punctuation is weird control
characters? Some systems are just not interoperable, and it really
seems to be by design!
-D
--
If we claim to be without sin, we deceive ourselves and the truth is not
in us.
I John 1:8