Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

UTF-8 problem in TCC related to Python

Jan
649
15
Hello

I have the following test-script in Python, encoded in UTF-8:

Python:
# encoding: utf-8

# Set the console codepage for this script to UTF-8
# Shouldn't be necessary through the 1st line: #encoding: utf-8
#os.system('chcp 65001')

print("jö, jä, jü")
print(u"jö, jä, jü")

After I open the Command Prompt, I can direct run the PY file OR with "python" at beginning without any problems with german umlauts, see here ...
py-prob01.PNG


However, if I try the same within TCC console, I HAVE the following problem after direct run the PY file (no problems with "python" at beginning) ...
py-prob02.PNG


Can somebody help me with this problem (Rex?)?

Greetings

PS: System data: Microsoft Windows 10 Pro x64 [18363.836] [1909] TCC 26.01.40 x64, Python 3.8.3 x64
PPS: I have NOT enabled the Unicode output and UTF-8 option for TCC. Also if I change the codepage to 65001 manually (or with the Python programm (with "os.system('chcp 65001')") it does not change anything. BTW: I KNOW that the "u" in python print command is deprecated since a while, I also know that the first line with "# encoding: utf-8" is not good style (if file is in utf-8 in Python 3.x) - it's just for testing purposes).
 

Attachments

  • testutf-8.zip
    283 bytes · Views: 381
Last edited:
No, it run always in "pure 1252" CP TCC window, except when I had changed for testing (which was even also not successful). That's a weird thing, because the call with "python program.py" does work ... I assume, this COULD be a specifiy problem with the call of the related DLL of python somehow (which runs over Command Prompt and does not work over TCC) ...

PS: Same result also with the Windows MAY update (Microsoft Windows 10 Pro x64 [19041.264] [2004] TCC 26.01.40 x64)

PPS: YES, the call of the python DLL (core) seems the reason. I saw, that the Command Prompt does start the python.exe instead loading the python core via DLL and then it runs without problem!

So, after I deactivated the Python Script language in the TCC options, it runs without problem too! Unfortunately, the autocompletion for py files is now also gone ...
 
Last edited:
Rex, is this problem with loading the Python Core DLL a Python problem or a TCC problem? OR, could you make a workaround?

Just a question - if it's not possible it's not the end of the world.
 

Similar threads

Back
Top