Home > front end >  Python cgi. Accept the json Chinese character data. The last Chinese character encoding.
Python cgi. Accept the json Chinese character data. The last Chinese character encoding.

Time:10-03



Drunk drunk,
With CGI into, but at the time of analytical Chinese characters,
Finally appeared in the coding of strange things, and also can't again decoding encoding (because the code is wrong)
Is my custom to decode, \ u534e \ u590f
But to get the json data into other,

For help, how to solve, you may be able to see the normal output operations, but later I must carry on the database operation,
This character can't do,
'utf-8' codec can 't encode characters in the position of 40 and 41: surrogates not allowed this is wrong information,

The incoming Chinese characters as database operation field, and what to do

CodePudding user response:

Try a try please try it out

CodePudding user response:

The
reference 1 floor console. The log () response:
try once a try please try it out

This is what the try, try it out

CodePudding user response:

https://blog.csdn.net/xjp_xujiping/article/details/81394640
Look at this issue

CodePudding user response:

The
reference 3 floor console. The log () response:

https://blog.csdn.net/xjp_xujiping/article/details/81394640See whether the problem

Emmm, and is not, is the problem of coding is determined, utf-8 send json data has a lot of problems,

CodePudding user response:

The
reference 3 floor console. The log () response:

https://blog.csdn.net/xjp_xujiping/article/details/81394640See whether the problem

Specific what the problem is I don't know the web site there are issues related to get articles look at yourself

CodePudding user response:


Reply, because the postman, to do a simulation to send, but the postman set encoding format is charset='GBK.
But in fact, not to do GBK encoding data,
So the solution is to write the json data file, the file coding format for GBK, then read the json format and sent out,,,,
  •  Tags:  
  • CGI
  • Related