fork(6) download
  1. # -*- coding: utf-8 -*-
  2. import json
  3.  
  4. L = [u'יחפים']
  5. json_text = json.dumps(L)
  6. print type(json_text), json_text
  7. json_text = json.dumps(L, ensure_ascii=False)
  8. print type(json_text), json_text.encode('utf-8')
Success #stdin #stdout 0.04s 6728KB
stdin
Standard input is empty
stdout
<type 'str'> ["\u05d9\u05d7\u05e4\u05d9\u05dd"]
<type 'unicode'> ["יחפים"]