Support for Devanagari Script

Vijaya Poudyal <[email protected]> Thu, 7 Sep 2006 18:06:38 -0700 (PDT)
Newsgroups gmane.comp.python.internationalization
Message-ID <[email protected]>
--0-618361328-1157677598=:80933
Content-Type: multipart/alternative; boundary="0-1547245554-1157677598=:80933"

--0-1547245554-1157677598=:80933
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by smtp-vbr1.xs4all.nl id k881DM4F070735

Hi,
  I have recently discovered the power of Python.  I started by trying to=
 implement a Sanskrit transliteration translation program.  I did accompl=
ish it but the Unicode Devanagari script is not displaying as I expect on=
 the python interpreter output lines.  The same sequence of unicode does =
render as expected if I write it to an html file and open it with a web b=
rowser. =20
  =20
  The attached code does both, I cannot figure out if I am doing somethin=
g wrong, or not setting up the fonts correctly in python, or python does =
not fully implement the unicode standard (for this script). =20
  =20
  I hope this is the right group to ask the question.  Thanks for any hel=
p.
  =20
  vjktm
  =20
  =20

 	=09
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rat=
es starting at 1=A2/min.
--0-1547245554-1157677598=:80933
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by smtp-vbr1.xs4all.nl id k881DM4F070735

<DIV>Hi,</DIV>  <DIV>I have recently discovered the power of Python.&nbsp=
; I started by trying to implement a Sanskrit transliteration translation=
 program.&nbsp; I did accomplish it but the Unicode Devanagari script is =
not displaying as I expect on the python interpreter output lines.&nbsp; =
The same sequence of unicode does render as expected if I write it to an =
html file and open it with a web browser.&nbsp; </DIV>  <DIV>&nbsp;</DIV>=
  <DIV>The attached code does both, I cannot figure out if I am doing som=
ething wrong, or not setting up the fonts correctly in python, or python =
does not fully implement the unicode standard (for this script).&nbsp; </=
DIV>  <DIV>&nbsp;</DIV>  <DIV>I hope this is&nbsp;the right group to ask =
the question.&nbsp; Thanks for any help.</DIV>  <DIV>&nbsp;</DIV>  <DIV>v=
jktm</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV><p>&#32;
		<hr size=3D1>Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone ca=
lls. <a href=3D"http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://=
us.rd.yahoo.com/evt=3D39666/*http://messenger.yahoo.com"> Great rates sta=
rting at 1=A2/min.
--0-1547245554-1157677598=:80933--
--0-618361328-1157677598=:80933
Content-Type: text/html; name="ex2.py"
Content-Description: 1718834162-ex2.py
Content-Disposition: inline; filename="ex2.py"

#Unicode Example
#vjktm
#
kSa=u'Hello \u0915\u094D\u0937'
fout = open('ex2.html','w')

head = """<html>
        <head>
        <title>Example 2</title>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
        </head>
        <body>
        <h1>Example 2</h1>
        <font face="mangal" color="#CC33FF" size="+2">
        """

foot = '</font></body></html>'

fout.write(head)
fout.write(kSa.encode('UTF-8'))
fout.write(foot)

fout.close()

print kSa

--0-618361328-1157677598=:80933
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

--0-618361328-1157677598=:80933--