Accentuated characters are mutilated ? lazarus / 34-Windows ---------------------------------------------------------------------- KlausGunther · 2013-01-05 01:07 On Windows, I have the following function to recover the text from a control, using its handle: Code: [Select]function MyFunction(hnd: pointer):istring; stdcall; export; var     len : integer;     text : string; begin     len := SendMessage(hnd, WM_GETTEXTLENGTH, 0, 0); // get the total text length     SetLength(text, len); // fixe la longueur pour text     SendMessage(hnd, WM_GETTEXT, len + 1, LParam(PChar(text)));  / get the text itself     result := text; end;      Now, I'm in France, and my texts contain french accentuated characters. And in LAzarus, the WM_GETTEXT message returns a modified text where all accentuated characters are replaced by reverse question marks. But exactly the same code works correctly in Delphi. So, the interception of french characters is obviously done by Lazarus. How can I tell Lazarus to let the french accentuated characters as teh are ? I'm using only 8 bit Ascii character set, no Unicode whatsoever.  There must be a quite obvious thing I have overseen ! ---------------------------------------------------------------------- User137 · 2013-01-05 01:20 Quote from: KlausGunther on January 05, 2013, 02:07:22 amI'm using only 8 bit Ascii character set, no Unicode whatsoever.You could tell more details about that. Lazarus uses UTF by default. I'm not entirely sure if it's {$H+} at beginning of each unit that does that, but could be. You can also try passing the string through UTF conversion functions. Some are UTF8ToSys(), SysToUTF8(), AnsiToUTF8(), UTF8ToAnsi()... ---------------------------------------------------------------------- KlausGunther · 2013-01-05 10:48 Thank you very much ! I did some googleing about Lazarus and Unicode. I don't say I'm already understanding all this, but I found the solution to my problem: I use AnsiToUTF8() to convert the string returned by the API and I can work with it. So: problem solved, and lots of new aspects to think about.