How do I convert an URL to human readable text ?

For example, I have a file name (extract form an URL) that I want to display %27 as ’ (and so on).

I checked DecodeURLComponent, but it does not convert it to me.

BTW: I do that after I extracted the file name (last “/” field), I keep the original link as found in the html source file.

This is a Desktop project.

[quote=425114:@Emile Schwarz]For example, I have a file name (extract form an URL) that I want to display %27 as ’ (and so on).

I checked DecodeURLComponent, but it does not convert it to me.

BTW: I do that after I extracted the file name (last “/” field), I keep the original link as found in the html source file.

This is a Desktop project.[/quote]
Uh… this is exactly what DecodeUrlComponent is for… but it’s not designed to do an entire url all at once.

It would be helpful to see an example url though.

Hi Greg,

I only want to set the file name part of the url to “human readable” (not the whole URL.

Example of a file name part of a link:

Frew_0808_%2528Frew%2529_%255BLXC%255D_%255BAthrak%255D.cbr

I want that:

Frew_0808_(Frew)_[LXC]_[Athrak].cbr

Far more easy to read it…

Thanks

@Emile Schwarz — For some reason, your string has been “percent-escaped” twice which is a problem. The following works, but there is no reasons why you should do that:

dim s as string = DecodeURLComponent( DecodeURLComponent( "Frew_0808_%2528Frew%2529_%255BLXC%255D_%255BAthrak%255D.cbr" ))

I do not understand the explanation, but the advice works fine, so…

BTW: I used the optional , Encodings.UTF8 syntax.

Thank you Stéphane.