Recent

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

EganSolo

  • Sr. Member
  • ****
  • Posts: 290
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';
  3.  

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

Martin_fr

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

Thaddy

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

But:
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 »
Specialize a type, not a var.

 

TinyPortal © 2005-2018