I have written a small script which basically prints some info at windows terminal(which uses greek cp737 codepage). It's essentially sth like this:
while True:
title = u'greek and other unichars follow:\t{}'.format(unicode_input())
print title.encode('cp737','ignore')
which outputs:
greek and other unichars follow: Καλημέρα!
which works as expected, terminal prints most of the greek letters and ignores rare exceptions which cant be translated to the much more constrained cp737.
Now in python3 when printing bytes, like u"unitext".encode(), outputs to stdout the bytes objects 'as-is':
b"greek and other unichars follow:\t\x89\x98\xa2\x9e\xa3\xe2\xa8\x98!"
Printing directly unicode in terminal will eventually lead to a UnicodeEncode error.
Converting unicode -> bytes(cp737,ignore) -> unicode, seems quirky.
So what is the elegant way of doing this?