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
+5.8k Golang : Extract unicode string from another unicode string example
+9.6k Golang : interface - when and where to use examples
+13.3k Android Studio : Password input and reveal password example
+15.4k Golang : Intercept Ctrl-C interrupt or kill signal and determine the signal type
+4.9k Golang : Constant and variable names in native language
+13.4k Golang : Strings comparison
+21k Golang : Convert(cast) string to rune and back to string example
+4.7k Which content-type(MIME type) to use for JSON data
+14.9k Golang : How do I get the local IP (non-loopback) address ?
+11k CodeIgniter : How to check if a session exist in PHP?
+5.8k Golang : Generate multiplication table from an integer example
+8.4k Linux/Unix : fatal: the Postfix mail system is already running