[Lazarus] FlipText

Sven Barth pascaldragon at googlemail.com
Thu Oct 21 09:55:20 CEST 2010


Am 20.10.2010 23:06, schrieb silvioprog:
> 2010/10/20 Sven Barth <pascaldragon at googlemail.com
> <mailto:pascaldragon at googlemail.com>>
>
>     If you're using Lazarus you can do
>
>     Canvas.TextOut(x, y, Utf8Encode(#$01dd));
>
>     When you're using Linux and you want to print on a utf8 stdout you
>     can use
>
>     Writeln(Utf8Encode(#$01dd));
>
>     Utf8Encode(WideString) converts an UTF-16 (fixed character length)
>     string to an UTF-8 (dynamic character length) string (Utf8Decode is
>     the reverse).
>
>     Regards,
>     Sven
>
>
> Fail: :(
>
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>    Caption := Utf8Encode(#$01dd);
> end;
>
> Error:
>
> ----
> unit1.pas(35,14) Error: Can't determine which overloaded function to call
>
> And:
>
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>    Caption := Utf8Encode(chr($01dd));
> end;
>
> Return Ý, and not ǝ (u01DD = ǝ: http://www.wilsonmar.com/1unicode.htm) :(

Let me guess... you're using Windows where UnicodeString <> WideString...

Try this:

Caption := Utf8Encode(UnicodeString(#$01dd));

Regards,
Sven




More information about the Lazarus mailing list