[Web-SIG] Encoding

Mohamad Babaei mo.babaei at gmail.com
Sat Mar 18 11:54:54 CET 2006


Hi,
I'm working on a program that fetches some translated texts from *Altavista
online translator , *it works fine with languages like German, french & ..
but it can not get translated text in Japanese or Russian or chinese.
my code is something like this:

##################################
data1 = urllib.urlopen('
http://www.babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_ru&url=http://www.google.com').read(
)
data1=data1.decode('utf-8')
f=open('/usr/local/new/tt.html','w')
f.write(data1.encode('utf-8'))
f.close()

###########################################

Any help appreciated.

Best Wishes,
M.Babaei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/web-sig/attachments/20060318/1a884cfb/attachment.html 


More information about the Web-SIG mailing list