Print a list that contains Chinese characters in Python
My code looks like : # -*- coding: utf-8 -*- print ["asdf", "中文"] print ["中文"] print "中文" The output in the Eclipse console is very strange: ['asdf', '\xe4\xb8\xad\xe6\x96\x87'] ['\xe4\xb8\xad\xe6\x96\x87'] 中文 My first question is: why did the last line get the correct output, and the others didn't? And my second question is: how do I correct the wrong ones (to make them output real characters instead of the code that begins with "x") ? Thank you guys!! why did the last line get the correct output, and the others didn't? When you print foo , what gets printed out is str(foo) . However, if foo