[python-win32] drag&drop files with non-ASCII filenames?

Random832 random832 at fastmail.com
Tue Dec 15 16:39:16 EST 2015


Tim Roberts <timr at probo.com> writes:
> The Windows console shell is an 8-bit entity.

That's not true. Well, it's only true A) of programs that use
8-bit I/O instead of Unicode (which unfortunately happens to
include Python, and B) when a bitmap font (i.e. Terminal) is
used instead of a truetype font.

Note that the bitmap font can't be changed with chcp either.

> Using msvcrt.getchw does not convert the console to a Unicode
> entity.  It merely means the characters you DO get are
> represented in Unicode.

Also not true. There are certainly problems with getwch, but any
unicode character that can actually be entered by a real keyboard
key, even on custom layouts that contain characters not in the
codepage, will work fine.

The limitation is the keyboard layout, not the codepage. Even
for pasted (or dropped) text, it will synthesize keyboard events
it can handle if a key exists for the character... otherwise, it
simulates alt-NNNN events that getwch cannot handle. If you
choose, for example, a Greek keyboard layout, even Latin letters
(definitely ASCII characters) can't be pasted to a getwch loop.



More information about the python-win32 mailing list