* * *

Author Topic: Debugging unicode strings?  (Read 1577 times)


  • Full Member
  • ***
  • Posts: 135
Debugging unicode strings?
« on: February 21, 2017, 12:36:37 am »
Hey guys, how do we setup the watch window to display unicode strings?
I've got a simple program I'm writing to test unicode capabilities. I'm having an issue with the command line display. It won't display the upper case accented A, as in À.

So, I set-up a breakpoint and added two variables to the watch window, this image shows you how they are displayed and the code shows you what I was expecting to see:
Code: Pascal  [Select]
  1. S1 = 'bonjour sérénitàa';
  2. S2 = 'sérénitàa';

Is there a switch I'm missing to get either GDB or Lazarus or fpc to do the right thing?


  • Administrator
  • Hero Member
  • *
  • Posts: 4587
    • wiki
Re: Debugging unicode strings?
« Reply #1 on: February 21, 2017, 12:48:08 am »
Unfortunately its not implemented.


  • Hero Member
  • *****
  • Posts: 6101
Re: Debugging unicode strings?
« Reply #2 on: February 21, 2017, 08:56:09 am »
Yes. It's a GDB issue too.

For linux console, try unicode_start to force unicode mode (most Linux consoles are already UTF8, but just in case)
For windows console, try chcp 65001 to force unicode mode (or cmd.exe /U )
Alternatively check what your code page is, by typing just chcp. Then you can also adapt your code to use that codepage....

Then run your program. Plz report back if it worked.
« Last Edit: February 21, 2017, 09:05:42 am by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969



Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus