writing unicode apps in python - some beginner questions.

Discussion in 'Python' started by WX, Feb 13, 2005.

  1. WX

    WX Guest

    I love Python, and the unicode support is wonderful.

    The character set I am using is the Hindi/Devanagari character set at
    unicode range U+901.)

    I have TWO newbie questions:

    (#1) If I paste some unicode stuff from the clipboard into IDLE, it
    accepts it, but it can't execute a PRINT command like this:

    >>> print u"हिनà¥à¤¦à¥€ सिखियà¤"

    Unsupported characters in input

    Should I report this as a bug or is it an essential limitation of the
    Python console/immediate mode?

    (#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?

    Regards,

    Warren
     
    WX, Feb 13, 2005
    #1
    1. Advertising

  2. "WX" wrote:

    > The character set I am using is the Hindi/Devanagari character set at
    > unicode range U+901.)
    >
    > (#1) If I paste some unicode stuff from the clipboard into IDLE, it accepts it, but it can't
    > execute a PRINT command like this:
    >
    > >>> print u"?????? ??????"

    > Unsupported characters in input
    >
    > Should I report this as a bug or is it an essential limitation of the Python console/immediate
    > mode?


    I don't see why it couldn't be fixed, so feel free to report it to the bug tracker.

    </F>
     
    Fredrik Lundh, Feb 13, 2005
    #2
    1. Advertising

  3. Hi!

    XP unicode view depend, also, of the uniscribe motor version. The last
    version come with SP-2.
    Other element : is the font "Arial Unicode MS" installed ?

    @-salutations
    --
    Michel Claveau
     
    News M Claveau /Hamster-P, Feb 13, 2005
    #3
  4. WX

    Serge Orlov Guest

    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?


    I suspect it's hidden in the windows registry. To find out where it's
    hidden try the following:
    1. Before installing supplemental language support export
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls
    into a text file using regedit
    2. Install supplemental language support
    3. Export the same registry branch into another file and compare with
    the first file.

    If there are no changes try doing the same for other registry branches:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
    HKEY_LOCAL_MACHINE\SYSTEM\

    After you find out what's going on you can use python's module
    _winreg to read the registry from your python program. Good luck.

    Serge.
     
    Serge Orlov, Feb 13, 2005
    #4
  5. WX

    Serge Orlov Guest

    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.
     
    Serge Orlov, Feb 13, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Last Timer

    [BEGINNER] Some questions

    Last Timer, Mar 12, 2005, in forum: C++
    Replies:
    6
    Views:
    327
  2. aph
    Replies:
    4
    Views:
    424
    Peter Hansen
    Jan 14, 2006
  3. Vincent Delporte

    War chest for writing web apps in Python?

    Vincent Delporte, Jul 28, 2006, in forum: Python
    Replies:
    22
    Views:
    730
    Nick Vatamaniuc
    Jul 29, 2006
  4. anonymous

    Call windows apps from web apps

    anonymous, Feb 22, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    229
    anonymous
    Feb 28, 2005
  5. Richard Choate

    Web enabled apps/Thin client apps

    Richard Choate, Jul 23, 2003, in forum: ASP General
    Replies:
    2
    Views:
    308
    Chris Barber
    Jul 23, 2003
Loading...

Share This Page