japanese, unicode and python

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

japanese, unicode and python

Zachary Mason
Hi.  Im writing an NLP application that manipulates japanese
characters and downloads japanese web-pages, in particular results
pages for japanese search engines.  Having a miserable time trying to
make it work so far.  I have python 2.4.3, but the transformations
that seem to work for european languages throw errors for japan.
Pointers to useful resources or better yet examples of manipulating
japanese via python would be greatly appreciated.

thanks
Z. Mason
_______________________________________________
I18n-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/i18n-sig
Reply | Threaded
Open this post in threaded view
|

Re: japanese, unicode and python

"Martin v. Löwis"
Zachary Mason wrote:
> Hi.  Im writing an NLP application that manipulates japanese
> characters and downloads japanese web-pages, in particular results
> pages for japanese search engines.  Having a miserable time trying to
> make it work so far.  I have python 2.4.3, but the transformations
> that seem to work for european languages throw errors for japan.
> Pointers to useful resources or better yet examples of manipulating
> japanese via python would be greatly appreciated.

This is a pretty unspecific question. What's wrong with doing stuff
like

py> u"Hello \u3068\u306f".encode("eucJP")
'Hello \xa4\xc8\xa4\xcf'

Regards,
Martin
_______________________________________________
I18n-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/i18n-sig