I am trying to stop the string in a post (in this case debugging I can see Any ideas? If you want to retain Instead of doing it by itself, ex: Update: Compare Hope this helps! value variable) To avoid the request it is to be stored in JSON. My code is
def addProduct (request): if request.POST: post = {} for the key in the request. POST: value = request 'Value' = json.loads (value) .encode ('utf-8') except for the POST [key] .encode ('utf-8 exception): pass {key] = value.encode (' utf-8 ') doc = Json.dumps (post)
value type of Unicode which I believe is how Django manages objects request actual string Although Unicode does not get special characters, unless
post [key] = value does not escape. If I change it to
post [key] = value.encode ( 'Utf-8') to convert If I try, I get an error:
'ascii' can not decode codec byte 0xe2 position 38: no serial number (128)
sure_sc = false .
Sunsh Chit_acci = incorrect I think the problem will be solved by avoiding the output
json
json.dumps ({'H': u '\ xc2 \ xa3'},
[7] ]: For json.dumps ({'a': u '\ n) to be
and
No comments:
Post a Comment