Theo,
with your solution, I need to convert from WideString to AnsiString again... I've found now a solution direct from UTF8 to Ansi:
procedure tMyForm.UTF8KeyPress(var UTF8Key: TUTF8Char);
var
Key : char;
uSt : utf8string;
St : ansistring;
begin
inherited UTF8KeyPress (UTF8Key);
uSt := utf8key;
St := lconvencoding.UTF8ToCP1252 (uSt);
if length(St) = 1 then begin
Key := St[1];
{processing the keyboard character input here}
end;
end;
It seems that the UTF8toAnsi and AnsiToUTF8 conversion routines work fine in Windows, but are not specific enough for Unix, because there are different Ansi codepages, and Unix does not know that Windows uses Codepage 1252 by default.
Martin