Windows Unicode support in Windows lazarus / 8-Other ---------------------------------------------------------------------- Derek · 2007-02-25 07:06 I am a Delphi user and looking at migrating some code to Linux, so Lazarus is very interesting and looks good.   One requirement is the need for unicode support.  I would prefer UTF-16, but can accept UTF-8 although it does require conversion to/from widestring on reading and writing. The main release does not yet support unicode but downloaded a snapshot a few days ago, but it did not work.  I did some digging and found an error in win32winapi.inc as it does not use the unicode call for SetWindowLong.  Looking at other forums, using an ANSI SetWindowLong causes windows to create a unicode control and then thunk everything to ansi. I have updated the function SetWindowLong to use the correct call, and it now works (tested in an Edit control), see below. Hope this helps development. P.S. Wasn't sure wher to post, so I decided to start a new thread. Function TWin32WidgetSet.SetWindowLong(Handle: HWND; Idx: Integer; NewLong: PtrInt): PtrInt; Begin   //TODO: Finish this;   Assert(False, Format('Trace:> [TWin32WidgetSet.SetWindowLong] HWND: 0x%x, Idx: 0x%x(%d), Value: 0x%x(%d)', [Handle, Idx, Idx, NewLong, NewLong])); {$ifdef ver2_0}   {$ifdef WindowsUnicodeSupport}     if UnicodeEnabledOS     then Result := Windows.SetWindowLongW(Handle, Idx, NewLong)     else Result := Windows.SetWindowLong(Handle, Idx, NewLong);   {$else}     Result := Windows.SetWindowLong(Handle, Idx, NewLong);   {$endif} {$else}   {$ifdef WindowsUnicodeSupport}     if UnicodeEnabledOS     then Result := Windows.SetWindowLongPtrW(Handle, Idx, NewLong)     else Result := Windows.SetWindowLongPtr(Handle, Idx, NewLong);   {$else}     Result := Windows.SetWindowLongPtr(Handle, Idx, NewLong);   {$endif} {$endif}   Assert(False, Format('Trace:< [TWin32WidgetSet.SetWindowLong] HWND: 0x%x, Idx: 0x%x(%d), Value: 0x%x(%d) --> 0x%x(%d)', [Handle, Idx, Idx, NewLong, NewLong, Result, Result])); End; ---------------------------------------------------------------------- felipemdc · 2007-02-25 14:47 Well, the standard way to send fixes is to download Lazarus from subversion, and then create a Patch. Can you do that? You can then send the patch to either the mailling list or to the bug tracker. Also make sure you have read the wiki page about unicode development: http://wiki.lazarus.freepascal.org/LCL_Unicode_Support thanks,