On Tue, 2006-01-31 at 13:11 +0200, Fatih Aşıcı wrote:
When using UTF-8 locale, I can't type some Turkish characters. I don't know whether it works with other languages. But it works at least in Turkish locale.
- have_chars = XLookupString(&e2, bufC, 2, &keysym, NULL);
- if(have_chars > 1){
MultiByteToWideChar(CP_UNIXCP, 0, bufC, -1, bufW, -1);
WideCharToMultiByte(CP_ACP, 0, bufW, -1, &ckey[i], 1, NULL,
NULL);
- }
Probably it works for Turkish locale but it won't work in general. Code pages often have characters which could not be be represented in other code pages and therefore will be lost.
Dmitry Timoshkov wrote:
On Tue, 2006-01-31 at 13:11 +0200, Fatih Aşıcı wrote:
When using UTF-8 locale, I can't type some Turkish characters. I don't know whether it works with other languages. But it works at least in Turkish locale.
- have_chars = XLookupString(&e2, bufC, 2, &keysym, NULL);
- if(have_chars > 1){
MultiByteToWideChar(CP_UNIXCP, 0, bufC, -1, bufW, -1);
WideCharToMultiByte(CP_ACP, 0, bufW, -1, &ckey[i], 1, NULL,
NULL);
- }
Probably it works for Turkish locale but it won't work in general. Code pages often have characters which could not be be represented in other code pages and therefore will be lost.
Then how should Fatih's problem be fixed?
On Tue, 2006-01-31 at 14:36 +0000, Robert Shearman wrote:
Then how should Fatih's problem be fixed?
I don't know. It works here just fine for ru_RU.UTF-8 and XLookupString apparently doesn't return UTF-8 encoded strings on keyboard detection, X11 sends UTF-8 encoded characters with KeyPress events though.