code: def dump_json(i):
      
  
      d=i['dict']
      si=i.get('skip_indent','')
  
      sk=False
      if i.get('sort_keys','')=='yes': sk=True
  
      try:
         if sys.version_info[0]>2:
            if si=='yes': s=json.dumps(d, ensure_ascii=False, sort_keys=sk)
            else:         s=json.dumps(d, indent=2, ensure_ascii=False, sort_keys=sk)
         else:
            if si=='yes': s=json.dumps(d, ensure_ascii=False, encoding='utf8', sort_keys=sk)
            else:         s=json.dumps(d, indent=2, ensure_ascii=False, encoding='utf8', sort_keys=sk)
      except Exception as e:
         return {'return':1, 'error':'problem converting dict to json ('+format(e)+')'}
  
      return {'return':0, 'string':s}
docs: Input:  {
                dict          - dictionary
                (skip_indent) - if 'yes', skip indent
                (sort_keys)   - if 'yes', sort keys
              }
  
      Output: {
                return       - return code =  0, if successful
                                           >  0, if error
  
                string       - json string (in utf8)
              }