id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 11742,simplejson loads not always unicode,kwek,nobody,"In our project we use import simplejson from django as it provides a nice wrapper around python having json compiled in itself or the use of simplejson. But now we've upgraded to django 1.1 i noticed the following difference. See the output of python without simplejson installed. Notice that it always returns as unicode for loads(). {{{ >>> from django.utils import simplejson >>> simplejson.loads('""test""', encoding='utf-8') u'test' >>> simplejson.loads('""test""') u'test' >>> Now see the output with simplejson installed. Notice that this returns as a normal string and not as unicode as some would expect. {{{ >>> from django.utils import simplejson >>> simplejson.loads('""test""') 'test' >>> simplejson.loads('""test""', encoding='utf-8') 'test' }}} And here the output of the python 2.6 json module (always unicode too) {{{ >>> import json >>> json.loads('""tuut""') u'tuut' }}} So is this by design or did this inconsistency sneak in with the new release? In the meantime we will just import json from python directly (2.6) but i thought ill mention it anyway. ",,closed,Uncategorized,1.1,,invalid,,mjbroek@…,Unreviewed,0,0,0,0,0,0