Problem with japanese characters in filenames

deja at gembook.org deja at gembook.org
Tue Oct 17 05:11:06 EDT 2000


In article <8sfjah$b0o$1 at news.BelWue.DE>,
  Jan Wender <ian at leo.science-computing.de> wrote:
> With Python 1.5.2 I had problems with japanese characters in filenames
> on MS Windows. In the native character encoding (952, I believe) the
> backslash is an allowed second character of a multibyte sequence. This
> broke os.listdir, because it splits directory and file names at
> backslashes.

For Python1.5.2, you can try pysjis and sjisntpath module.

http://www.gembook.org/python/pysjis-zip
(source and binary for win32. Document is written in Japanese)

pysjis and sjisntpath are Japanese SJIS encoding aware version of the
standard string and sjisntpath module. To install them, just copy
sjisntpath.py, pysjis.py, sjisstrop.pyd into your PYTHONPATH.

Home this helps,

======
Atsuo Ishimoto
ishimoto at gembook.org


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list