Am 20.10.2010 23:06, schrieb silvioprog:
2010/10/20 Sven Barth <[email protected]
<mailto:[email protected]>>

    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

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to