Python Print Utf-8

Source URL: https://stackoverflow.com/questions/3597480/how-to-make-python-3-print-utf8

Language: python

Created on: 2021-05-17 16:41:52

# credit to the Stack Overflow user in the source link

TestText = "Test - āĀēĒčČ..šŠūŪžŽ" # this not UTF-8...it is a Unicode string in Python 3.X.
TestText2 = TestText.encode('utf8') # this is a UTF-8-encoded byte string.
How can I make python 3 (3.1) print("Some text") to stdout in UTF-8, or how to output raw bytes? Test.py TestText = "Test - āĀēĒčČ..šŠūŪžŽ" # this is UTF-8 TestText2 = b"Te...
content_copy