locale support and 4.10

T

Timothy Smith

i'm trying to setlocale() on 4.10, and it appears the python package
doesn't support this under 4.10.

Python 2.3.3 (#2, Apr 28 2004, 22:48:37)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/locale.py", line 381, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

the exact same thing works under windows xp.

do i have to compile it with locale support?

also my second question. once i have this working how do i set the
thousands_sep character to be a "," ?
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Timothy said:
the exact same thing works under windows xp.
do i have to compile it with locale support?

No. You have to choose a locale name that is supported by your
operating system (which appears to be FreeBSD). Read your OS
documentation for what valid locale names are; most likely,
"en_US" or "en_US.ISO-8859-1" are supported.
also my second question. once i have this working how do i set the
thousands_sep character to be a "," ?

You don't directly set it. It is a property of the locale.

Regards,
Martin
 
T

Timothy Smith

Martin said:
No. You have to choose a locale name that is supported by your
operating system (which appears to be FreeBSD). Read your OS
documentation for what valid locale names are; most likely,
"en_US" or "en_US.ISO-8859-1" are supported.



You don't directly set it. It is a property of the locale.

Regards,
Martin

something strange is happening, no matter what i try nothing is a
supported locale
and yes it's freebsd 4.10
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Timothy said:
something strange is happening, no matter what i try nothing is a
supported locale and yes it's freebsd 4.10

Sounds like a problem with your operating system. AFAICT, you ought
to have a directory /usr/share/locale on your disk. What is its
contents?

Regards,
Martin
 
M

Michael Piotrowski

Timothy Smith said:
something strange is happening, no matter what i try nothing is a
supported locale
and yes it's freebsd 4.10

AFAIK, the locale support in FreeBSD 4.1 is incomplete. Support for
LC_NUMERIC was only added in 4.6 - the release notes for 4.6 say:

The locale support was synchronized with the code from FreeBSD
-CURRENT. This change brings support for the LC_NUMERIC,
LC_MONETARY, and LC_MESSAGES categories, as well as improvements to
strftime(3), revised locale definitions, and improvement of the
localization of many base system programs.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top