Title: RE: [Web-SIG] Encoding

Mohamad Babaei wrote:
> 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="" href="http://www.google.com').read(">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()

1. Have you examined the response headers on a request for Japanese content and verified that the response is encoded in UTF-8?
2. Why decode it just to turn around and encode it again with the same encoding?


Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]

_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to