Issues printing unicode characters

20 views
Skip to first unread message

kivaar

unread,
Sep 29, 2020, 12:04:25 PM9/29/20
to PyInstaller
Hi there,

I'm facing an issue where my PyInstaller program doesn't print special characters and will stop printing other strings following this. The source code doesn't have this problem.

At a high level, this issue arises when printing a basic string concatenated with another string containing a special character. The example code below will only print "apple" and then further print statements will not make it to stdout.

print("apple\n" + "México")

I'm on Win10 with Python 3.8.5 and PyInstaller 4.0

Any ideas? Thanks in advance!

bwoodsend

unread,
Sep 30, 2020, 6:41:00 AM9/30/20
to PyInstaller

I’m not getting this issue when I test your little print snippet. Do you have an encoding shebang at the top of your script (such as # -*- coding: utf-8 -*-)?

Also, Windows’s cmd prompt isn’t utf-8 by default. When you say The source code doesn’t have this problem, did you verify that it works normally from cmd (i.e. python my_code.py) or just your Python IDE?

kivaar

unread,
Sep 30, 2020, 10:10:25 AM9/30/20
to PyInstaller
No encoding statement in the script. It works normally from Git Bash. I'm using Gooey as a GUI and then packaging the whole thing with PyInstaller: https://github.com/chriskiehl/Gooey#packaging

After answering your question I may have found the solution (https://github.com/chriskiehl/Gooey/issues/520). Will give this a go. Thanks for your help!
Reply all
Reply to author
Forward
0 new messages