[I18n-sig] Support for Devanagari Script
Vijaya Poudyal
vjktm at yahoo.com
Fri Sep 8 13:31:34 CEST 2006
Andy,
Thanks for investigating this. I am using IDLE in windows 2000 and XP.
I will try the variations you tried and will report the results.
Thanks.
vjktm
Andy Robinson <andy at reportlab.com> wrote:
> The main determining factor is whether the stdout can render the
> bytestream that's thrown at it, and that depends on where you are
> running your script. For example, on Windows, IDLE renders your UTF16
> exactly the same as Firefox, Opera and IE6 render the UTF8 in the
> created ex2.html. However running the script at the (DOS) command prompt
> will throw an exception (unless there's a Devanagari DOS codepage).
Regrettably not all fonts have the character set you want and the DOS
prompt is not a smart enough display device. However, browsers and IDLE
are smart enough to switch to a 'fallback font' for characters they
cannot display.
In Idle, which uses Courier (300kb on Windows), I get;
>>> print kSa.encode('UTF-8')
works fine.
>>> print kSa.encode('UTF-16')
prints rubbish.
>>> print kSa
works too but is almost certainly converting to utf8.
>From a DOS prompt, the UTF8 version prints rubbish. The command prompt
font properties only give me two font choices, 'Raster Fonts' and
'Lucida Console'. When I switch IDLE to a variety of different fonts, I
still get the Devanagari character, IN THE SAME TYPEFACE, whichever font
I choose.
Conclusion: DOS prompt does not have the display routines needed to
handle Unicode output.
- Andy Robinson
---------------------------------
Want to be your own boss? Learn how on Yahoo! Small Business.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/i18n-sig/attachments/20060908/fd2a66ae/attachment.htm
More information about the I18n-sig
mailing list