Debug Console not showing Unicode

  • retag add tags

I need to display some Arabic script in my Debug Console, but I can't seem to convince it to work in utf-8. Here's a test I can run while at a breakpoint in my code, which doesn't require any code in particular:

import sys
sys.stdout.encoding
'ascii'
print("مرحبا")
مرحبا
print('test')
test

After typing in those commands, my Debug Console looks much like the text above, except the Arabic in print statement is in a mono-spaced font, the ending parenthesis on that line is overlapping text next to the other one, and the line between the two print statements is completely empty.

I have tried adding PYTHONIOENCODING=utf-8 to the project properties environment, and I have confirmed that Debugger > I/O in Preferences has utf-8 for both Debug and Shell I/O Encoding.

JeffH's avatar
51
JeffH
asked 2025-05-21 06:59:41 -0500
edit flag offensive 0 remove flag close merge delete

Comments

This almost certainly due to the right to left text support (or the lack thereof) in Wing's editor. What version of Wing are you using?

Wingware Support's avatar Wingware Support (2025-05-21 07:32:18 -0500) edit

Using Wing Pro 10.0.9.1

JeffH's avatar JeffH (2025-05-21 09:03:09 -0500) edit

But check this out: print('testing: [' + converted[1] + ']') testing: [أ] It prints an individual character just fine, but when I print the full string with "print(converted)", it gives me an empty line, but if I copy and paste that line, the characters are there.

JeffH's avatar JeffH (2025-05-21 09:09:12 -0500) edit

If I use print("Testing: " + converted), it prints out the whole Arabic string. If I use print(">" + converted), it prints out nothing on the screen, but if I copy the "empty" line and paste it elsewhere, the string is actually there. So yes, this does somehow seem to be a problem of lack of RTL support in the Console somehow.

JeffH's avatar JeffH (2025-05-21 09:22:52 -0500) edit

We'll look further into this and try to improve it in the future, but RTL text isn't currently supported. You may want to use an external console for debug i/o -- I know that this won't help with the debug probe, but it's a work around for normal output from your program.

Wingware Support's avatar Wingware Support (2025-05-21 11:31:04 -0500) edit
add a comment see more comments