Hello:
Does anyone know if wxWidgets provides a way to take a string and add the special encoding necessary for a URL. For example if I'm sending something like this:
http://www.mysite.com/up.php?access=dos ... ddress=100 Oak #30&address2=2nd Floor
The "#" sign is considered an unsafe character and will cause problems unless it is encoded.
Any ideas?
Thanks a bunch.
Chris
URL Encoding Topic is solved
Did you try to use wxURI?
Code: Select all
wxURI url (wxT("http://www.mysite.com/up.php?access=dosomething&address=100 Oak #30&address2=2nd Floor"));
wxString encoded_url = url.BuildURI();
Problem with wxURI.Create() and unusal filenames
wxURI tries to encode url's, but gives unexpected results when offering a input string that looks like it is already encoded, example:
- input ftp://my_site/some_folder/%%3B3B93B93C1D9%%_myfile.php
(note: names like these are used by Smarty for certain files)
- wxURI assumes the "%3B" is already encode (which it isn't really) and makes something like:
.../%25%3B....
while it should have been:
.../%25%253B....
I suppose that because "%3B" looks like an encoded character, wxURI is not touching it.
Could this be a bug in wxURI, or is it perhaps a shortcoming that you can not force wxURI.Create() to assume the offered string is not encoded?
- input ftp://my_site/some_folder/%%3B3B93B93C1D9%%_myfile.php
(note: names like these are used by Smarty for certain files)
- wxURI assumes the "%3B" is already encode (which it isn't really) and makes something like:
.../%25%3B....
while it should have been:
.../%25%253B....
I suppose that because "%3B" looks like an encoded character, wxURI is not touching it.
Could this be a bug in wxURI, or is it perhaps a shortcoming that you can not force wxURI.Create() to assume the offered string is not encoded?