Le lundi 09 mai 2011 à 22:18 -0500, Michael Urman a écrit : > On Mon, May 9, 2011 at 20:08, Neil Hodgson <nyamatongwe at gmail.com> wrote: > > Yes, Windows will use UTF-16 as it does for almost everything. From > > a user's point of view, these should both just be seen as Unicode. > > I'm not convinced this is correct for this case. GetProcAddress takes > an "ANSI" string, meaning while it could theoretically use UTF-8, in > practice I doubt it uses anything outside of ASCII safely. If GetProcAddress() expects a byte string encoded to the ANSI code page, my patch is correct because the function used the UTF-8 encoding, not the ANSI code page. We can maybe use GetProcAddressW() to pass a Unicode string. I don't know which encoding is used by GetProcAddressW()... I already patched _PyImport_GetDynLoadFunc() for Windows: the path is now a Unicode object instead of a byte string encoded to the filesystem encoding. _PyImport_GetDynLoadWindows() uses GetFullPathNameW() and LoadLibraryExW(). The work to be fully Unicode compliant (for the path field, not for the name) is not completly done... but I have a pending patch, see: http://bugs.python.org/issue11619 But this patch is huge and creates many functions. I am not sure that we need it, I will work on this later. Victor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4