[Development] URL: who needs DecodeUnambiguousDelimiters?

0 views
Skip to first unread message

Thiago Macieira

unread,
Mar 29, 2012, 11:15:19 PM3/29/12
to devel...@qt-project.org
Suppose the URL:

file:///hash(%23)in path: ☺

which, after re-jigging, has:
path() == "/hash(#)in path: ☺";
and
path(QUrl::FullyEncoded) == "/hash(%23)in%20path:%20%E2%98%BA";

Question: can anyone come up with a valid use-case for
path(something here) == "/hash(%23)in path: ☺" ?

That is, obtain exactly what appears in the URL when toString() is called?
Note that you can obtain that by running:

toString(QUrl::RemoveAuthority | QUrl::RemoveScheme |
QUrl::RemoveQuery | QUrl::RemoveFragment);

The above trick works for all components, except the username and password --
the hostname cannot be removed without removing them as well.[1]

With that in mind, unless someone objects, I'm going to merge the
DecodeUnambiguousDelimiters and DecodeAllDelimiters into one enum only --
DecodeDelimiters.


[1] the enum already has the reserved bits for RemoveHost and RemoveUserName
and has had them since Qt 4.0. We could add them later.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden

signature.asc
Reply all
Reply to author
Forward
0 new messages