D
ddtl
Hello everybody,
I want to create a script which reads files in a
current directory and renames them according to some
scheme. The file names are in Russian - sometimes
the names encoded as win-1251, sometimes as koi8-r etc.
I want to read in file name and convert it to list for
further processing. The problem is that Python treats
non-ascii characters as multibyte characters - for
example, hex code for "Small Character A" in koi8-r is
0xc1, but Python interprets it as a sequence of
\xd0, \xb1 bytes.
What can I do so that Python interprets non-ascii
characters correctly?
I want to create a script which reads files in a
current directory and renames them according to some
scheme. The file names are in Russian - sometimes
the names encoded as win-1251, sometimes as koi8-r etc.
I want to read in file name and convert it to list for
further processing. The problem is that Python treats
non-ascii characters as multibyte characters - for
example, hex code for "Small Character A" in koi8-r is
0xc1, but Python interprets it as a sequence of
\xd0, \xb1 bytes.
What can I do so that Python interprets non-ascii
characters correctly?