On 7/16/07, Felipe Monteiro de Carvalho <[EMAIL PROTECTED]> wrote:
Hi,I was studying more about the unicode support, and I compiled my lcl for the partial unicode support available and tryed to run one form with 1 button, 1 label and 1 edit, with this code: procedure TForm1.Button1Click(Sender: TObject); var MyStr: UTF8String; begin MyStr := 'Accents á, é, í, ó, ú Polsko: ć, ę, ł, ś, ź, ż'; // Label1.Font.Name := 'Times New Roman'; Label1.Caption := MyStr; Edit1.Text := MyStr; Button1.Caption := MyStr; end; UTF-8 encoded obviously But, the accented words are not shown. They appear as empty spaces. I tryed without setting anything on the font, with arial, with times new roman. My current guess is that the font doesn't support those characters, but it would be quite wierd if the standard font doesn't. The implementation of SetText for win32 seams ok for me: class procedure TWin32WSWinControl.SetText(const AWinControl: TWinControl; const AText: string); Begin if not WSCheckHandleAllocated(AWincontrol, 'SetText') then Exit; {$ifdef WindowsUnicodeSupport} if UnicodeEnabledOS then Windows.SetWindowTextW(AWinControl.Handle, PWideChar(Utf8Decode(AText))) else Windows.SetWindowText(AWinControl.Handle, PChar(Utf8ToAnsi(AText))); {$else} Windows.SetWindowText(AWinControl.Handle, PChar(AText)); {$endif} End; Any ideas?
Have you set the font family to unicode ? Default font families are usually latin1 (or your system setting).
thanks, -- Felipe Monteiro de Carvalho
Ido -- http://ik.homelinux.org/ _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
