Debug Console not showing Unicode
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.
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?
Using Wing Pro 10.0.9.1
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.
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.
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.