writing unicode apps in python - some beginner questions.

Serge Orlov Serge.Orlov at gmail.com
Sun Feb 13 08:19:02 EST 2005


WX wrote:
> (#2) Hindi is not displayed correctly on the screen when the
> "Suplemental language support" parts for Windows XP are not installed,
> in particular in the Regional and Languages  Options panel in the
> Control Panel, you have to check "Install files for complex script and
> right-to-left languages (including Thai)".  This adds Thai, and Indic
> language support.  Does anyone know a programmatic way in Python to
> check for this,so I can pop up a message telling users that support
> for this script hasn't been installed in Windows?

In addition to my previous post you can try the following, more
simple method: try calling setlocale, if Thai support is installed I suspect
you won't get an exception:

>>> import locale
>>> locale.setlocale(locale.LC_ALL,'English')
'English_United States.1252'
>>> locale.setlocale(locale.LC_ALL,'Russian')
'Russian_Russia.1251'
>>> locale.setlocale(locale.LC_ALL,'Thai')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Python24\lib\locale.py", line 379, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

  Serge.








More information about the Python-list mailing list