[Lazarus] Debugging fixed strings in UTF8 encoding

Martin lazarus at mfriebe.de
Fri Mar 29 03:21:16 CET 2013


On 29/03/2013 01:18, Ernest V Miller wrote:
>
>>
>> There are 2 issues (in what I reproduced):
>>
>> 1) *** "???"
>>
>> Actually the "?" are really present in the string. They are put there by
>> Utf8ToAnsi for characters that could not be translated to ansi. So in
>> that the debugger shows the correct content.
>>
>> At least that happens with the chars I used for testing:
>        Despite the fact that each character of 'Кукла' is represented in
> ansi, Utf8ToAnsi gives ? in exchange for every normal ansi symbol.
>        Interesting thing is that further call of
>              AnsiToUtf8(ansi);  //ansi contains '?????' as a result of
> previous Utf8ToAnsi('Кукла') conversion
>        returns 'Кукла' again, not '?????'.
>
>

Ok, than you have an error that I can not reproduce on my system.  I 
made my observation from reproducing the effects on my system as close 
as I can get to it.
For me GDB never did the ??? thing.

Can you generate a log please 
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

The above sting in 4 versions: utf8 and ansi both for unlimited strings 
and string[x]
And the source, so I can see what is what.

Is your ansi a multibyte ansi? Maybe GDB does not understand that? (just 
a wild guess)


Also:
Are you on Windows? Which one?
32 or 64 bit?
which version of GDB? (If you do the log, I can find it from that)

Can you try (including another log) using a newer GDB
* win 32 bit:
- IDE comes with 7.2-1
- go to http://sourceforge.net/projects/mingw/files/MinGW/Extension/gdb/
* win 64 bit
- IDE (not sure) IIRC 7.3.5
- http://www.drangon.org/mingw/

The IDE supports all versions (6.3 to 7.5 / upcoming 7.6 has not yet 
been tested).
But at least the 32 bit versions 7.3 and up have issues that can lead to 
gdb loosing the debug session)






More information about the Lazarus mailing list