Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] ruby and python in Japan



Hello Brett,

On 2/27/07, Brett Robson <b-robson@??> wrote:
I haven't had to deal with Japanese in PHP yet, but my understanding is
that PHP doesn't support Unicode and apparently Python does. Does anyone
have experience with Japanese programming in PHP or Python?

Regarding python, there has been native support for unicode strings from version 2.0 or so. It means that you can take a byte stream and decode it into a unicode string... or you can take a unicode string and encode it into one of the common text encoding such as utf-8, sjis, euc-jp etc.

Maybe this is obvious, but this is your responsibility as a programmer
to check your input (is it euc-jp, utf-8, utf-16 encoded string), turn
that into a unicode string for processing  (decode) (including regular
expression and the like) and then when returning the result (to the
screen, printer, file, socket etc...) to encode the result in the
encoding expected by the API.

I would say that unicode support (hence Japanese support) is
straightforward enough in python it never gives any pain.

Have fun.

Regards,

Guillaume


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links