What is the difference between the behaviour of the function "ToAscii" on windows 7 and windows 10?

0 like 0 dislike
I get the code down virtual key, from the procedure lowlevelkeyboardproc ( via SetWindowsHookExA). When you try to put it into a readable form using the “ToAscii(info.vkCode, info.scanCode, keyboardState, ascii, 0)”
so I tried:
“ToAscii(info.vkCode, MapVirtualKey!!(info.vkCode, 0.toUInt()), keyboardState, ascii, 0)” and it gave the same result:
In windows 10, all English letters and other symbols are identified correctly, but running on windows 7 displays not readable characters.
It must be a problem in the coding, but used Windows-1251 in both cases.
I looked in the standard library KN, there is no ability to work with encodings, and from the world of C “ToAscii”, as seen in the problem behaves strangely.

Also interesting point, if I write at the beginning of system(“cmd /c programm.exe”), the characters become illegible in both versions of windows.
by | 151 views

1 Answer

0 like 0 dislike
In the "cmd /c programm.exe" it turns out cp866 encoding instead of windows-1251. At least in Windows 7.

Related questions

110,608 questions
257,187 answers
40,796 users