How to encode QUrl
-
i wanted to know how to encode a url i have after searching and browsing tried many functions but it does not works.i have seen QUrl and QUrlQuery functions but it did not worked.Please tell me an easy way to encdode ? , & + and others actually i want to encode search query in my web browser
-
"http://doc.qt.nokia.com/4.7-snapshot/qurl.html#toPercentEncoding":http://doc.qt.nokia.com/4.7-snapshot/qurl.html#toPercentEncoding
It's Qt documentation. And now you should write on the board:
I will read documentation.
I will read documentation.
I will read documentation.
I will read documentation.
I will read documentation. -
let me tell you that i have used it and it did not worked thats why i am asking and i have drinked QUrl documentation
and you should right on the board:
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot -
Might be buggy. QUrl is getting a massive update in Qt5, try there.
-
right might be but for know what is the perfect step i should take my project is serious and i have many few days left
-
AFAIN, QUrl::toPercentEncoding(..) working well, but if you don't like it, you should write your own toPercentEncoding(..). I can help you with resources - "http://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters":http://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters
[quote author="developer" date="1340354083"]let me tell you that i have used it and it did not worked thats why i am asking and i have drinked QUrl documentation
and you should right on the board:
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot
developer asks question only after researching a lot[/quote] -
thanks man and sorry for my previous post i should not say that for good guys
-
Also it might help if you actually tell what you are doing (post some code) and what is not working (compile error, unexpected result,...).
-
yes off course i am doing that
-
[quote author="developer" date="1340354836"]thanks man and sorry for my previous post i should not say that for good guys[/quote]
Can you show your code??? I hate when people on devnet asks "code-questions" without posting code. I can't understand what actually you want, there are can be 100500 different variants.
-
the same problem which comes with http://doc.qt.nokia.com/4.7-snapshot/qurl.html#toPercentEncoding
actaully my code replaces the strings but and there to but there is still a white space
if a user searches php & asp
then the google url is created as http://www.google.com/search?q=php&asp
and the google search is php&asp in normal it even does not do this
my stupid function:
@ query.replace("!" , "!");
query.replace("#" , "#");
query.replace("$" , "$");
query.replace("&" , "&");
query.replace("'" , "'");
query.replace("(" , "(");
query.replace(")" , ")");
query.replace("" , "");
query.replace("+" , "+");
query.replace("," , ",");
query.replace("/" , "/");
query.replace(":" , ":");
query.replace(";" , ";");
query.replace("=" , "=");
query.replace("?" , "?");
query.replace("@" , "@");
query.replace("[" , "[");
query.replace("]" , "]");
return query;@ -
something is wrong this is not my function this is due to a reason:
my function image:
http://dl.dropbox.com/u/35031827/Screenshot from 2012-06-22 14:53:29.png -
just copy the full line above and paste it in a web borwser and it iwll work
-
Fix the link, please.
-
the problem with link is that it has white spaces so drop box give me encoded one but the forums decoded it again so plase copy yhte last line full and paste it in your web browser
-
In the message box, there is an icon of 3 connected links (a chain) - this should be used to post links into the forum.
-
thanks man i want to tell you that this is all a matter of encoding and even persistence encoding is doing the same task as my function same to same
the new link hopes it works :"my link if does not work please follow my previous post":http://dl.dropbox.com/u/35031827/Screenshot from 2012-06-22 14:53:29.png
[quote author="sierdzio" date="1340357332"]In the message box, there is an icon of 3 connected links (a chain) - this should be used to post links into the forum.[/quote] -
it still does not works
-
Yay, we've found a bug :-)
-
but my is stable qt version 4.8 where to report bug for this