[Lazarus] PAnsiChar to UTF8 issues

Howard Page-Clark hdpc at talktalk.net
Tue Apr 9 20:42:05 CEST 2013


On 09/04/13 6:35, Leonardo M. Ramé wrote:
>>>>> Well, I can live with the debugger problem, but is there a solution for
>>>>> the "?" sign end displaying in my app?.
>>>>>
>>>> If you get an ansi string, you must convert it to utf8 before giving
>>>> it to the LCL
>>>>
>>>> need to find the exact function
>>>>
>>>> label.caption :- ansitoutf8(s) // assuming it is ansi in the system codepage
>>>>
>>> Yes, I've tried that, but it shows a box with an X inside where the ñ
>>> should appear...
>>>
>>> My codepage is es_AR.UTF-8.
>>>
>> u:unicodestring;
>>
>> u:=Putf8Char(buf); // or PAnsiChar depends on what your C DLL returns
>>
>> label.caption:=u; // implicit cast
>>
>
> No, I've tried all kinds of combinations of ansitoutf8, unicodestring,
> etc, but nothing works, all returns "?" or the box with the X in the
> place of "ñ" or accents.

Impertinent question really, but do you know for certain that the font 
assigned to your label has glyphs corresponding to each unicode entity 
your string contains?





More information about the Lazarus mailing list