[Lazarus] Unable to display symbols
Mattias Gaertner
nc-gaertnma at netcologne.de
Sat Mar 8 14:05:13 CET 2014
On Sat, 08 Mar 2014 13:52:12 +0100
Giuliano Colla <giuliano.colla at fastwebnet.it> wrote:
> Hello,
>
> I'm porting to Lazarus a Kylix application, where I need to display the
> special symbols in the range $A0 to $BF such as: ¦ ¡ ¢ £ ¤ ¥, etc.
> (Actually I'm using a font where those symbols are replaced by other
> symbols related to the application, but that's not relevant).
> But while, on the same platform, the Kylix application displays them
> properly, the Lazarus application using the same code doesn't: with GTK2
> ws they display as question marks or as crossed boxes, with Qt ws they
> display as blanks.
>
> The code is sort of:
>
> aText: string;
> .....
> aText := 'SomeString' + char(ord($A0));
> .....
> canvas.TextOut(Pos.X,Pos.Y,aText);
> Label1.caption := aText;
>
> Changing type from string to UTF8String has no effect.
>
> What I'm doing wrong?
The solution lies in your own mail. Your mail is UTF-8 and so are the
above characters. Just copy the above characters from your mail to the
IDE:
aText := 'SomeString¥';
Note: Keep in mind that "char" is a single byte, but ¥ in UTF-8 is
multiple bytes.
Mattias
More information about the Lazarus
mailing list