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
+8.6k Golang : Create matrix with Gonum Matrix package example
+3.7k Golang : ROT32768 (rotate by 0x80) UTF-8 strings example
+14.5k Golang : Get download file size
+17.8k Golang : Read a file into an array or slice example
+8.3k Golang : Wait and sync.WaitGroup example
+3k Javascript : How to show different content with noscript?
+4.5k PHP : How to check if an array is empty ?
+3.9k Golang : If else example and common mistake
+7k Golang : Temperatures conversion example
+15.2k Golang : Get all upper case or lower case characters from string example
+10.1k Golang : calculate elapsed run time