In Python, for Japanese, Chinese, and Korean,Python can not print the correct strings, for example hello in Japanese, Korean and Chinese are:
こん
My python version 2.7.11 and operating system is Mac OSX,I write
こんにちは
안녕하세요
你好
to test.txt. My program is :
# -*-coding:utf-8-*-
import json
if __name__ == '__main__':
f = open("./test.txt", "r")
a = f.readlines()
print json.dumps(a, ensure_ascii=False)
f.close()
run the program, result:
["こんにちは\n", "안녕하세요\n", "你好"]