+ 3
how i encode unicode chrs in python
so im making chr list gen,but its limited to 127 cuz idk how to encode unicode chrs https://code.sololearn.com/cY2cyRkUWVPe/?ref=app try to change range(0,127) to range(0,256) and it wont work
2 ответов
+ 4
Add these lines at the beginning of your code:
import unicodedata
import sys, codecs
sys.stdout = codecs.getwriter('utf_16')(sys.stdout.buffer, 'strict')
Also, you don't need to increase i in your for loop. That's literally what for i in range is for. Neither strings nor chars have to be converted to strings in order to print them