Re: Support for Devanagari Script
Vijaya Poudyal <[email protected]> Fri, 8 Sep 2006 15:46:19 -0700 (PDT)
| Newsgroups | gmane.comp.python.internationalization |
|---|---|
| Message-ID | <[email protected]> |
--===============1912562211==
Content-Type: multipart/alternative; boundary="0-1154950974-1157755579=:79854"
--0-1154950974-1157755579=:79854
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by smtp-vbr13.xs4all.nl id k88MkNjA076341
Hi Andy,
I tried my example at the command prompt in XP and Xbash (cygwin). Pyt=
hon cannot decode the unicode in both cases. In IDLE I get the wrong ren=
dering. I was not able to the "renders ... exactly the same ..." behavio=
r you mentioned.
=20
When you say kSa.encode('utf8') do you get "Hello" followed by two char=
acters joined along the top or just one character (as in the html)? When=
I run it I get two characters and this is a wrong rendering of the code =
point sequence.
=20
vjktm
Andy Robinson <[email protected]> wrote:
> The main determining factor is whether the stdout can render the l
> bytestream that's thrown at it, and that depends on where you are=20
> running your script. For example, on Windows, IDLE renders your UTF16=20
> exactly the same as Firefox, Opera and IE6 render the UTF8 in the=20
> created ex2.html. However running the script at the (DOS) command promp=
t=20
> will throw an exception (unless there's a Devanagari DOS codepage).
Regrettably not all fonts have the character set you want and the DOS=20
prompt is not a smart enough display device. However, browsers and IDLE=20
are smart enough to switch to a 'fallback font' for characters they=20
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=20
font properties only give me two font choices, 'Raster Fonts' and=20
'Lucida Console'. When I switch IDLE to a variety of different fonts, I=20
still get the Devanagari character, IN THE SAME TYPEFACE, whichever font=20
I choose.
Conclusion: DOS prompt does not have the display routines needed to=20
handle Unicode output.
- Andy Robinson
=09
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ co=
untries) for 2=A2/min or less.
--0-1154950974-1157755579=:79854
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by smtp-vbr13.xs4all.nl id k88MkNjA076341
<div>Hi Andy,</div> <div>I tried my example at the command prompt in XP =
and Xbash (cygwin). Python cannot decode the unicode in both cases.=
In IDLE I get the wrong rendering. I was not able to the "re=
nders ... exactly the same ..." behavior you mentioned.</div> <div> =
;</div> <div>When you say kSa.encode('utf8') do you get "Hello" followed=
by two characters joined along the top or just one character (as in the =
html)? When I run it I get two characters and this is a wrong rende=
ring of the code point sequence.</div> <div> </div> <div>vjktm<BR>=
<BR><B><I>Andy Robinson <[email protected]></I></B> wrote:</div> =
<BLOCKQUOTE class=3Dreplbq style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #1010ff 2px solid">> The main determining factor is wheth=
er the stdout can render the l<BR>> bytestream that's thrown at it, an=
d that depends on where you are <BR>> running your script. For example=
, on Windows, IDLE renders your UTF16
<BR>> exactly the same as Firefox, Opera and IE6 render the UTF8 in t=
he <BR>> created ex2.html. However running the script at the (DOS) com=
mand prompt <BR>> will throw an exception (unless there's a Devanagari=
DOS codepage).<BR><BR>Regrettably not all fonts have the character set y=
ou want and the DOS <BR>prompt is not a smart enough display device. Howe=
ver, browsers and IDLE <BR>are smart enough to switch to a 'fallback font=
' for characters they <BR>cannot display.<BR><BR>In Idle, which uses Cour=
ier (300kb on Windows), I get;<BR><BR>>>> print kSa.encode('UTF-=
8')<BR><BR>works fine.<BR><BR>>>> print kSa.encode('UTF-16')<BR>=
<BR>prints rubbish.<BR><BR>>>> print kSa<BR>works too but is alm=
ost certainly converting to utf8.<BR><BR>From a DOS prompt, the UTF8 vers=
ion prints rubbish. The command prompt <BR>font properties only give me t=
wo font choices, 'Raster Fonts' and <BR>'Lucida Console'. When I switch I=
DLE to a variety of different fonts, I
<BR>still get the Devanagari character, IN THE SAME TYPEFACE, whichever =
font <BR>I choose.<BR><BR>Conclusion: DOS prompt does not have the displa=
y routines needed to <BR>handle Unicode output.<BR><BR>- Andy Robinson<BR=
><BR><BR></BLOCKQUOTE><BR><p> 
<hr size=3D1>Yahoo! Messenger with Voice. <a href=3D"http://us.rd.yahoo=
.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=3D39663/*http:=
//voice.yahoo.com">Make PC-to-Phone Calls</a> to the US (and 30+ countrie=
s) for 2=A2/min or less.
--0-1154950974-1157755579=:79854--
--===============1912562211==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
_______________________________________________
I18n-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/i18n-sig
--===============1912562211==--