URL decoding

Just starting out? Need help? Post your questions and find answers here.
BarryG
Addict
Addict
Posts: 4176
Joined: Thu Apr 18, 2019 8:17 am

URL decoding

Post by BarryG »

Is this supposed to give the output I want, or is it a bug, or am I way off the mark about it?

Code: Select all

Debug URLDecoder("My PC's Files") ; Want: My PC's Files
Little John
Addict
Addict
Posts: 4791
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: URL decoding

Post by Little John »

BarryG wrote: Is this supposed to give the output I want
No.

Code: Select all

; Want: My PC's Files

Debug URLEncoder("My PC's Files")      ; -> "My%20PC's%20Files"
Debug URLDecoder("My%20PC's%20Files")  ; -> "My PC's Files"
BarryG
Addict
Addict
Posts: 4176
Joined: Thu Apr 18, 2019 8:17 am

Re: URL decoding

Post by BarryG »

So how would I convert HTML encoding like this to it's normal plain text -> "My PC's Files"
Little John
Addict
Addict
Posts: 4791
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: URL decoding

Post by Little John »

For HTML en/decoding, we have to write our own code, see e.g.
viewtopic.php?p=276574#p276574
BarryG
Addict
Addict
Posts: 4176
Joined: Thu Apr 18, 2019 8:17 am

Re: URL decoding

Post by BarryG »

I came up with a (bad hacky) routine to fix it. All good now.
Post Reply