Python : Print unicode escape characters and string
Couple of examples on how to print unicode string in Python. Nothing fancy, but it helps to explore the ways to print unicode characters in Python.
# - *- coding: utf- 8 - *-
print " 我爱你"
print u'\u0420\u043e\u0441\u0441\u0438\u044f'
goodmorning = "おはよう"
print (goodmorning)
Output :
我爱你
Россия
おはよう
Reference :
See also : Python : Fix SyntaxError: Non-ASCII character in file, but no encoding declared
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+22.8k Golang : Round float to precision example
+14.5k Golang : How to shuffle elements in array or slice?
+11.6k Golang : Generate DSA private, public key and PEM files example
+8.9k Golang : Executing and evaluating nested loop in html template
+14.8k Golang : Reset buffer example
+7.2k Golang : Transform lisp or spinal case to Pascal case example
+12.4k Golang : Validate email address
+18.9k Golang : Delete duplicate items from a slice/array
+6.4k PHP : How to handle URI or URL with non-ASCII characters such as Chinese/Japanese/Korean(CJK) ?
+8.8k Golang : Heap sort example
+7k Golang : Join lines with certain suffix symbol example
+10.9k Golang : Natural string sorting example