URL decode a string?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

URL decode a string?

Post by rullbandspelare » Fri Nov 06, 2009 4:28 pm

Hi!
I have a string that needs to be URL decoded.
for example: "/>


Will I have to do a stringreplace for every character or is there a simpler way in MS?

i.e replace " with "

Thanks!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Nov 06, 2009 6:53 pm

StringReplace> will work on strings, not just on individual characters. Strings can also b e represented by variables.

RegEx> will also work on strings based on patterns, vs. characters.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Post by rullbandspelare » Sat Nov 07, 2009 3:47 pm

Thanks!
My idea was to do parse the file via HTTPRequest. Cos as soon a webbrowser reads the file it is URL decoded.
This works if i open the local file c:\URLEncodedText.htm with IE.

Like this:
HTTPRequest>c:\URLEncodedText.htm,,GET,,HTMLResponse

rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Post by rullbandspelare » Sat Nov 07, 2009 5:23 pm

I have mixed it up. I mean that my text is HTML encoded and that I wish to decode it!!!!

HTML = HTML encoded, the way you would embed such a character in HTML (e.g. á for á)

URL = URL encoded, the way such a character should be specified in a querystring


Thanks!

rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Post by rullbandspelare » Mon Nov 09, 2009 9:28 am

Here is what I did to solve it.

[quote]
StringReplace>Out,&#229 ;,Ã¥,Out
StringReplace>Out,&#228 ;,ä,Out
StringReplace>Out,&#246 ;,ö,Out
StringReplace>Out,&#197 ;,Ã…,Out
StringReplace>Out,&#196 ;,Ä,Out
StringReplace>Out,&#214 ;,Ö,Out
StringReplace>Out,&#252 ;,ü,Out
StringReplace>Out,&#220 ;,Ü,Out
StringReplace>Out,&#233 ;,é,Out
StringReplace>Out,&#201 ;,É,Out
StringReplace>Out,&quot ;,",Out
StringReplace>Out,&lt ;,Out,&gt ;,>,Out
[/quote]

Ps I had to add a space in the code "&#201 ;" , otherwise Your browser translates it.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts