Answers for "how to format unicode python"

2

python print unicode character

def str_to_unicode(s: str):
    return s.encode("unicode_escape").decode()
print(str_to_unicode('Python is Great '))
Posted by: Guest on June-24-2021
0

how to read unicode in python

import codecs
with codecs.open('unicode.rst', encoding='utf-8') as f:
    for line in f:
        print repr(line)
Posted by: Guest on July-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language