Your QString is a collection of Unicode character codes. The character 'À' is Unicode code point U+00C0. The UTF-8 encoding for that code point is two bytes 0xC3 0x80. I think you can see where your result is coming from. This behaviour is exactly as documented http://doc.qt.io/qt-5/qurl.html#toPercentEncoding
The original RFC talks about encoding the ASCII value of reserved characters: there is no ASCII code for 'À'. RFC 3986, in 2005, changed this to UTF-8, which explains the Qt behaviour.
Your server is expecting that the character has been encoded with a local eight bit encoding (probably Windows CP1252) where that character would be a single byte 0xC0. It is possible the server triggers UTF-8 handling if the request has an Accept-Charset header listing utf-8, so that is worth a try. If not, you may have to manually encode the bytes out of QString:toLocal8Bit() to get the result your server expects.




Reply With Quote

Bookmarks