How can I POST Unicode data with QNetworkAcccessManager
I filled a QString object with Unicode data and tried to send it with QNetworkAcccessManager.post method and in server I received some ?????? instead of Unicode characters but the JSON format was valid on server (I send data in this format). Then I used QString.toUtf8 method before send开发者_如何学Pythoning and there was some strange characters (maybe correct ones) on server but JSON format was not valid, it means JSON decoder function of Rails framework didn't parse it. Can you help me?
Converting your string to QByteArray using toUtf8() and then using post is working here.
For me, it's rather a server issue than a client one. To prove it, you can:
- Try to generate the request using another framework (e.g. python)
- use wireshark to dump network communication
Moreover, you should state which version of Qt you're using, it might help reproduce.
精彩评论