# coding:utf
import json
def test_dict_output():
a_dict = {'a': u'你好',
'b': u'中国'}
a_dict_str = json.dumps(a_dict, ensure_ascii=False).encode('utf-8')
print(a_dict_str)
def test_list_output():
a_list = [u'你好', u'中国']
print(' '.join(a_list))
print(str(a_list).decode('unicode-escape'))
print(json.dumps(a_list, ensure_ascii=False))
if __name__ == '__main__':
test_dict_output()
test_list_output()
{"a": "你好", "b": "中国"}
你好 中国
[u'你好', u'中国']
["你好", "中国"]