473,411 Members | 2,285 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

writing unicode apps in python - some beginner questions.

WX
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
Jul 18 '05 #1
4 1841
"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>

Jul 18 '05 #2
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
Jul 18 '05 #3
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\Contro l\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.


Jul 18 '05 #4
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.

Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: sebastien.hugues | last post by:
Hi I would like to retrieve the application data directory path of the logged user on windows XP. To achieve this goal i use the environment variable APPDATA. The logged user has this name:...
19
by: Gerson Kurz | last post by:
AAAAAAAARG I hate the way python handles unicode. Here is a nice problem for y'all to enjoy: say you have a variable thats unicode directory = u"c:\temp" Its unicode not because you want it...
3
by: Michael Weir | last post by:
I'm sure this is a very simple thing to do, once you know how to do it, but I am having no fun at all trying to write utf-8 strings to a unicode file. Does anyone have a couple of lines of code...
4
by: Guilherme Salgado | last post by:
Hi there, I have a python source file encoded in unicode(utf-8) with some iso8859-1 strings. I've encoded this file as utf-8 in the hope that python will understand these strings as unicode...
7
by: Robert | last post by:
Hello, I'm using Pythonwin and py2.3 (py2.4). I did not come clear with this: I want to use win32-fuctions like win32ui.MessageBox, listctrl.InsertItem ..... to get unicode strings on the...
2
by: Yury | last post by:
I am new to python and programming generally, but someday it is time to start :) I am writing a python module in C and have a question about multibyte character strings in python<=>C. I want a C...
2
by: enquiring mind | last post by:
I read the posting by Rehceb Rotkiv and response but don't know if it relates to my problem in any way. I only want to write German to the screen/console for little German programs/exercises in...
1
by: anonymous | last post by:
1 Objective to write little programs to help me learn German. See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2 Want keyboard answer input, for...
20
by: Marin Brkic | last post by:
Hello all, please, let me apologize in advance. English is not my first language (not even my second one), so excuse any errors with which I'm about to embarass myself in front of the general...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.