title: Python Unicode ajax form posting error
body: <p>i got a n00b problem with python and i've been searching here for a while and i couldnt find a proper solution...</p>
  
  <p>i got a utf8 form that i ajax post to a python page. i read the json simplejson with utf-8 charset.</p>
  
  <p>the text is fine as long as there is no mixed utf8 and latin chars like ?!;, etc...</p>
  
  <p>UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 0: ordinal not in range(128)</p>
  
  <pre><code>commentjsonarray = simplejson.loads(commentjson, encoding='utf-8')
  </code></pre>
  
  <p>i tried a bunch of things but i cant get it to work.
  help.</p>
  
  <h2>just an update for you with more code for help, thanks</h2>
  
  <p>commentjson = request.POST['commentObj']</p>
  
  <pre><code>commentjsonarray = simplejson.loads(commentjson, encoding='utf-8')
  program = get_object(Program, commentjsonarray['programid'])
  userget = get_object(User, commentjsonarray['userid'])
  #get user avatar from usermeta
  usermeta = get_object(UserMeta, 'user_id = ',userget.key())
  commenttext = commentjsonarray['walltext']
  from django.utils.encoding import smart_unicode,force_unicode,smart_str
  
  commenttext = smart_str(commenttext)
  
  newcomment = db_create(Wall, user_avatarurl=str(usermeta.avatarurlsmall),user_fullname=str(''+userget.first_name+' '+userget.last_name),user_idstring=str(userget.key()),text = str(commenttext) , program_id = program.key() , user_id = userget.key())
  </code></pre>
  
  <p>above is the python part.
  here is the javascript:</p>
  
  <pre><code>var walltext = $('walltext').value
  
   var commentObj = {"walltext": ""+walltext+"", "programid": programid, "userid": userid};
   var commentJSON = encodeURIComponent(Object.toJSON(commentObj));
  if (walltext != '' || walltext == 'type here' || walltext.length &gt; 0) {
  
      new Ajax.Request('/wall/new', {
          method: 'post',
          encoding: 'UTF-8',
          parameters: 'commentObj=' + commentJSON,
          onSuccess: function(request){
              var msg = request.responseText.evalJSON();
              if (msg) {
  
                  var structure = '&lt;div id="' + msg.msgid + '"&gt;&lt;img src="' + msg.avatarurl + '" width="18" height="18"&gt; ' + msg.username + ':' + msg.text + '&lt;div id="frontSepLine"&gt;&lt;/div&gt;&lt;/div&gt;';
  
                  //$('programwall').insert({bottom:structure});
                  refreshWall(msg.programid);
  
                  $('walltext').value = 'type here';
  
                  var objDiv = document.getElementById("programwall");
                  objDiv.scrollTop = objDiv.scrollHeight;
  
  
              }
  
  
  
          }
      });
  </code></pre>