win32-foreign-load.lisp:
(define-alien-routine ("LoadLibraryA" loadlibrary) hinstance
(file c-string))
Shouldn't this be replaced by LoadLibraryW and :utf-16le c-string? That would correctly handle non-ASCII paths.
IIRC c-string without format specifier uses :UTF-8, which is not what 'A' functions expect(those expect CP_ACP, which is an alias to the current system-specific locale, say CP1251 in case of russian localization)
Also, GetModuleHandleW defined below in the same file should have :external-format of :utf-16le instead of :ucs-2. `W' functions expect UTF-16/LE.
As for the GetProcAddress - it also uses CP_ACP(and does not have a unicode(i.e. `W') version), but in whole my life I've never encountered a single DLL that had an exported function that used non-ASCII characters. Those may exist, but handling CP_ACP would require handling all possible Windows ANSI code pages. So the solution is to limit function names to ASCII characters.
Patch attached.
Best regards,
Dmitry