* * *

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

EganSolo

  • Jr. Member
  • **
  • Posts: 75
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: 4280
    • wiki
Re: Debugging unicode strings?
« Reply #1 on: February 21, 2017, 12:48:08 am »
Unfortunately its not implemented.

Thaddy

  • Hero Member
  • *****
  • Posts: 3971
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 »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

 

Recent

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