Problem with japanese characters in filenames
Neil Hodgson
neilh at scintilla.org
Mon Oct 16 23:03:17 EDT 2000
Jan Wender:
> 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.
Could you post your code?
I don't have 1.5.2 source on my machine, but reading 1.6 does not show
anything that I would consider splitting directory and filenames at
backslashes. There is some code to append a "/*.*" at the end of the input
argument, but the file names are copied straight from the OS returned buffer
into a list of strings with no parsing of the results.
You can also try the Win32 exensions:
win32api.FindFiles("C:\\zed\\*.py")
which give back more information.
Neil
More information about the Python-list
mailing list