Re: How to convert between Japanese coding systems?

2009-02-19 Thread Lie Ryan
On Thu, 19 Feb 2009 15:28:12 +0900, Dietrich Bollmann wrote: > Hi, > > Are there any functions in python to convert between different Japanese > coding systems? If I'm not mistaken, the email standard specifies that only 7-bit ASCII- encoded bytes can be transported safely and reliably. The high

Re: How to convert between Japanese coding systems?

2009-02-19 Thread Justin Ezequiel
import email from email.Header import decode_header from unicodedata import name as un MS = '''\ Subject: =?UTF-8?Q? romaji=E3=81=B2=E3=82=89=E3=81=8C=E3=81=AA=E3=82=AB=E3=82=BF?= Date: Thu, 19 Feb 2009 09:34:56 - MIME-Version: 1.0 Content-Type: text/plain; charset=EUC-JP Content-Transfer-Enco

Re: How to convert between Japanese coding systems?

2009-02-19 Thread Justin Ezequiel
On Feb 19, 2:28 pm, Dietrich Bollmann wrote: > Are there any functions in python to convert between different Japanese > coding systems? > > I would like to convert between (at least) ISO-2022-JP, UTF-8, EUC-JP > and SJIS.  I also need some function to encode / decode base64 encoded > strings. > >

Re: How to convert between Japanese coding systems?

2009-02-18 Thread Peter Otten
Dietrich Bollmann wrote: > I get the strings (which actually are emails) from a server on the > internet with: > > import urllib > server = urllib.urlopen(serverURL, parameters) > email = server.read() > > The coding systems are given in the response string: > > Example: > > email = '''[

How to convert between Japanese coding systems?

2009-02-18 Thread Dietrich Bollmann
Hi, Are there any functions in python to convert between different Japanese coding systems? I would like to convert between (at least) ISO-2022-JP, UTF-8, EUC-JP and SJIS. I also need some function to encode / decode base64 encoded strings. I get the strings (which actually are emails) from a s