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
+6.4k Golang : Hue, Saturation and Value(HSV) with OpenCV example
+26.6k Golang : Change a file last modified date and time
+20.1k Golang : Upload big file (larger than 100MB) to AWS S3 with multipart upload
+18.3k Golang : Archive directory with tar and gzip
+10.6k Golang : How to detect a server/machine network interface capabilities?
+11.2k Golang : How to check if a string starts or ends with certain characters or words?
+4k HTTP common errors and their meaning explained
+10.6k Golang : convert(cast) float to string
+14.5k Golang : Read large file with bufio.Scanner cause token too long error
+4.2k Golang : Pad file extension automagically
+12.7k Golang : How to convert a number to words
+18.5k Golang : How to count the number of repeated characters in a string?