Ensure that QUrl::{to,from}LocalPath encode/decode properly
authorThiago Macieira <thiago.macieira@intel.com>
Mon, 23 Apr 2012 15:16:31 +0000 (17:16 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 26 Apr 2012 01:15:22 +0000 (03:15 +0200)
commitf6aef23ff162d9849f5be1036c9f45c2ee506d21
treedfa65e69cfdd009a9072d554fd54391fc1420a87
parentf9048b3465d163a3c4e12fe6b9261d42a996b314
Ensure that QUrl::{to,from}LocalPath encode/decode properly

Unlike path(), toLocalFile() isn't reporting a URL component, so it
should decode the percent-encoded characters fully. This extra
decoding pass is meant to catch %00 to %1F, %7F and %25 (the percent
sign itself).

It also catches %80 to %FF, which aren't decoded because they don't
form UTF-8 sequences. That means QUrl::toLocalFile() has undefined
behaviour if the path contained non-UTF8 sequences.

Task-number: QTBUG-25459
Change-Id: Iab5a0ba6afcfc4510e297984f2ffc208cedd752b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
src/corelib/io/qurl.cpp
tests/auto/corelib/io/qurl/tst_qurl.cpp