unicode bug in turkish characters?

"Martin v. Löwis" martin at v.loewis.de
Fri Apr 4 18:59:06 EST 2003


oktaysafak at ixir.com schrieb:
>>>>locale.setlocale(locale.LC_ALL, "tr_tr")
> 
> Traceback (most recent call last):
>   File "<pyshell#3>", line 1, in ?
>     locale.setlocale(locale.LC_ALL, "tr_tr")
>   File "C:\PYTHON23\lib\locale.py", line 381, in setlocale
>     return _setlocale(category, locale)
> Error: locale setting not supported
> 
>>>>locale.setlocale(locale.LC_ALL, "turkish")
> 
> 'Turkish_Turkey.1254'

Ah, I see. Windows. My example was from Linux, where tr_TR is a
valid locale name.

Python delegates the toupper call to the operating system. It does not,
in itself, include a database of lower/upper case conversions for all 
locales.

So there is nothing we can do about that; ask Microsoft.

> Locale defaults as determined by getdefaultlocale():
> ------------------------------------------------------------------------
> Language:  tr_TR
> Encoding:  cp1254

Please understand that getdefaultlocale does *not* determine
the locale used by the program. Instead, it determines (sometimes)
the locale that Python would use if you had invoked setlocale
with "", i.e. asking for the user's preference (sometimes,
getdefaultlocale just doesn't work).

Regards,
Martin





More information about the Python-list mailing list