3 ms·
I invest some karma to point out how I'd love for str to just use UTF-8 by default, and print as UTF-8 by default: print(b'DONT b"EVERYTHING!"') print(str(b'S
by singularity2001 8y ago
I invest some karma to point out how I'd love for str to just use UTF-8 by default, and print as UTF-8 by default:
print(b'DONT b"EVERYTHING!"')
print(str(b'SAME!'))
print(str(b'I DONT WANT TO add ,"UTF-8" everywhere!','UTF-8'))
line="ום עולם"
output.write(line) # TypeError: a bytes-like object is required, not 'str'
fp.write(output.getvalue()) # TypeError: write() argument must be str, not bytes
Please at least allow us to set a global option via
sys.setdefaultencoding('UTF8')
as before to automatically encode/decode as UTF-8 by default!