<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problem with QUrlQuery::toString(QUrl::FullyEncoded) (.toUtf8()) ,with character &#x27;+&#x27;]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I have the following code :</p>
<pre><code>QUrlQuery postData;

....
postData.addQueryItem("objet",objet);

postData.addQueryItem("message",message);

QByteArray b=postdata.toString(QUrl::FullyEncoded) .toUtf8(); 
m_reponse = m_pNetManager-&gt;post(requete,  postData.toString(QUrl::FullyEncoded).toUtf8());
</code></pre>
<p dir="auto">When objet or message contains the character '+' ,the variable b contains this character not encoded (not as %) and the webservices php (api rest) receive a space character instead of '+'.I think that postData.toString(QUrl::FullyEncoded) has a bug because the character '+' must be encoded like '%n'....</p>
]]></description><link>https://forum.qt.io/topic/63828/problem-with-qurlquery-tostring-qurl-fullyencoded-toutf8-with-character</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 11:49:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/63828.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Feb 2016 09:56:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem with QUrlQuery::toString(QUrl::FullyEncoded) (.toUtf8()) ,with character &#x27;+&#x27; on Fri, 05 Feb 2016 16:50:52 GMT]]></title><description><![CDATA[<p dir="auto">OK thanks Wieland,<br />
I had this problem with version Qt 5.3.2 compiled from sources for windows, with 5.4.1 for linux and with 5.4.2 for MacOSX.</p>
]]></description><link>https://forum.qt.io/post/311708</link><guid isPermaLink="true">https://forum.qt.io/post/311708</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 05 Feb 2016 16:50:52 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with QUrlQuery::toString(QUrl::FullyEncoded) (.toUtf8()) ,with character &#x27;+&#x27; on Fri, 05 Feb 2016 15:00:25 GMT]]></title><description><![CDATA[<p dir="auto">Hi! This bug has been reported as <a href="https://bugreports.qt.io/browse/QTBUG-50001" target="_blank" rel="noopener noreferrer nofollow ugc">QTBUG-50001</a>.</p>
]]></description><link>https://forum.qt.io/post/311688</link><guid isPermaLink="true">https://forum.qt.io/post/311688</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 05 Feb 2016 15:00:25 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with QUrlQuery::toString(QUrl::FullyEncoded) (.toUtf8()) ,with character &#x27;+&#x27; on Fri, 05 Feb 2016 14:52:25 GMT]]></title><description><![CDATA[<p dir="auto">I have fixed it with</p>
<pre><code>objet.replace(QChar('+'),QString("%2B"));
message.replace(QChar('+'),QString("%2B"));

postData.addQueryItem("objet",objet);

postData.addQueryItem("message",message);

</code></pre>
<p dir="auto">but it 'is a bug of the method QUrlQuery::toString(QUrl::FullyEncoded),that should encode the character '+' as "%2B"...<br />
my problem is solved.</p>
]]></description><link>https://forum.qt.io/post/311686</link><guid isPermaLink="true">https://forum.qt.io/post/311686</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 05 Feb 2016 14:52:25 GMT</pubDate></item></channel></rss>