WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: RAK on December 23, 2013, 10:02:33 PM

Title: editing a url that contains '%'
Post by: RAK on December 23, 2013, 10:02:33 PM
I have been trying to edit a url that may contain a percent character. %20, %3, %2 are the ones I am working with. I tried a few things and no luck - string functions err and I cannot replace them so far.

thanks
Title: Re: editing a url that contains '%'
Post by: hdsouza on December 24, 2013, 08:50:58 AM
Not sure what you mean by editing a URL.
If u are trying to open the url, that try placing the URL into a variable and then write code around the variable
Title: Re: editing a url that contains '%'
Post by: Deana on December 24, 2013, 09:56:32 AM
Quote from: RAK on December 23, 2013, 10:02:33 PM
I have been trying to edit a url that may contain a percent character. %20, %3, %2 are the ones I am working with. I tried a few things and no luck - string functions err and I cannot replace them so far.

thanks

Take a look at the WinInet Extender function iUrlDecode. It takes a string in URL encoded format and converts it to plain text.

Code (winbatch) Select
AddExtender("WWINT44I.DLL",0,"WWINT64I.DLL")
sEncoded = 'Burgers%%26Fries%%20at%%2050%%%%20off!!!??!!!'  ;Escaped using double percent signs (for WinBatch)
sPlain = iUrlDecode (sEncoded)
Message ('iUrlDecode', 'Encoded string: ': sEncoded: @CRLF: 'Plain string:': sPlain)
Title: Re: editing a url that contains '%'
Post by: RAK on December 24, 2013, 02:40:20 PM
YES! this is what I was looking for.. I knew it was there somewhere but could not remember it..

thanks!