[Lazarus] How do I use Unicode characters on MacOS / Carbon?

Tom Gregorovic _tom_ at centrum.cz
Sun Oct 5 09:42:22 CEST 2008


On Sun, Oct 5, 2008 at 9:03 AM, Brad Campbell <brad at wasp.net.au> wrote:
> G'day all.
>
> On Linux/gtk2 I simply do this
>
> Edit1.Text := WideChar($F080);
>
> I don't even need to specify the font name as it's the only one with that character and it just gets
> pulled up.
>
> On Carbon all I get is '?' in the non ASCII char ranges.
>
> I've tried specifying the font by name ..
>
> Edit1.Font.Name := 'Parallax';
>
> ..and the ASCII chars use that font, but still nothing outside the $20 - $7E range.
>
> I'm trying to use these unicode chars in a Synedit and directly on a canvas with
>
> Canvas.TextOut(aRect.Left + 2, aRect.Top + 2, WideChar(B));
>
> Linux, no problem.. works perfectly.
>
> Am I doing something obviously silly?
>

You have to pass strings to the LCL in UTF-8 encoding on all
platforms. You can use UTF16ToUTF8 conversion routine from LCLProc
unit.

Tom Gregorovic



More information about the Lazarus mailing list