# URL Decoding to ASCII Characters in the Album Parser Script

**URL:** https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477
**Category:** Web Sources Discussion
**Created:** [January 21, 2011, 12:16pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477 "2011-01-21T12:16:21Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [January 21, 2011, 12:16pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/1 "2011-01-21T12:16:21Z")

</div>

For my discogs scripts I would like to implement a way to parse the _Discogs Standard Name_ if a _Discogs Name Variation_ is used for a release.  
But this name is only hidden in a link where it is URL-encoded. Is there a way to decode URLs in the album parser to get the correct ASCII Character.

like here: [http://www.w3schools.com/tags/ref\_urlencode.asp](http://www.w3schools.com/tags/ref_urlencode.asp)  
%21 \> !  
%22 \> "  
%23 \> #  
...

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [January 21, 2011, 4:26pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/2 "2011-01-21T16:26:26Z")

</div>

> [@pone](#):
>
> ... Is there a way to decode URLs in the album parser to get the correct ASCII Character.

Mp3tag does not provide such a dedicated function.

You have already a complete URL Encoding Reference, so you can build your own decoder using the $Replace() or $RegexpReplace() functions.

See also:  
~~[http://cid-387b58366897ac93.office.live.co](http://cid-387b58366897ac93.office.live.co)...odeURI.v105.hta~~  
[http://cid-387b58366897ac93.office.live.co...ponent.v106.hta](http://cid-387b58366897ac93.office.live.com/self.aspx/HTADecodeURI/HTADecodeURIComponent.v106.hta)

DD.20110121.1957.CET  
Edit.DD.20111211.1433.CET

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [January 22, 2011, 1:31pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/3 "2011-01-22T13:31:06Z")

</div>

> [@DetlevD](#):
>
> Mp3tag does not provide such a dedicated function.
> 
> You have already a complete URL Encoding Reference, so you can build your own decoder using the $Replace() or $RegexpReplace() functions.

I know of course. I was just hoping that there might be an easier way.

To built this in the script in full function, I have to do these 224 (!) replaces on three fixed palces (albumartist, credits, notes) plus artist and mixartist within the tracks loop for every track. On a release with 10 tracks this would be 5152 (!!!) replaces.  
I guess this would make the script significant slower, wouldn't it?

---

<div class="post-metadata">

### Author: ![glamour\_pike](https://community.mp3tag.de/user_avatar/community.mp3tag.de/glamour_pike/32/294_2.png) [@glamour\_pike](https://community.mp3tag.de/u/glamour_pike)
#### Post date: [December 9, 2011, 8:13pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/4 "2011-12-09T20:13:41Z")

</div>

I wonder what happened to this?  
I also stumbled upon this for a simple export script. As far as i see it works without such a step in Firefox, but does it speak for every browser?

Edit:  
Oh, i spoke too soon. It is the other way around. URL Encoding.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [December 10, 2011, 9:26am UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/5 "2011-12-10T09:26:47Z")

</div>

> [@glamour\_pike](#):
>
> ... It is the other way around. URL Encoding.

There are offered two simple tools for URI encoding and decoding ...  
[file:/// durch normalen Pfad ersetzen](https://community.mp3tag.de/t/10430/2)

DD.20111210.1127.CET

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [December 10, 2011, 12:00pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/6 "2011-12-10T12:00:28Z")

</div>

> [@glamour\_pike](#):
>
> I wonder what happened to this?

I've built a URL decoding option into the newest version of my discogs script.  
[[WS] Discogs (pone mod)](https://community.mp3tag.de/t/9226/231)

It works, but it makes the script slower.  
I've only built in the first character set, called "Basic Latin", as I found it here [http://www.utf8-zeichentabelle.de/unicode-....pl?number=1024](http://www.utf8-zeichentabelle.de/unicode-utf8-table.pl?number=1024) into my script.  
That alone where 921 replaces. So if I wanted to build in all characters, that would really blow up the size of the script too much.

It should be possible to reverse decoding to encoding and write the syntax for export scripts.  
Something like $replace(...,%21,!,%22,",%23,#,%24,$,%25,%,%26,&,...)  
Keep in mind that you have to replace the special characters of the Mp3tag export syntax.  
And you have to use a text editior where you can write all the special characters.

@Detlev:  
Is there a way to built your tool into Mp3tag's Web Sources process?

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [December 11, 2011, 12:22pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/7 "2011-12-11T12:22:47Z")

</div>

> [@pone](#):
>
> ... @Detlev:  
> Is there a way to built your tool into Mp3tag's Web Sources process?

My HTA encoding and decoding tools do a simple call to a Javascript function.  
That is not supported by Mp3tag.

Both functions UrlEncode and UrlDecode are essential when dealing with the Internet, particularly in the context of "Mp3tag Websource Scripts".  
I wonder why these functions are not supplied by Mp3tag.

DD.2011211.1424.CET

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [December 11, 2011, 2:33pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/8 "2011-12-11T14:33:25Z")

</div>

Where does a web source script need these functions?

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [December 11, 2011, 4:04pm UTC](https://community.mp3tag.de/t/url-decoding-to-ascii-characters-in-the-album-parser-script/11477/9 "2011-12-11T16:04:17Z")

</div>

To read the discogs main artist name at release pages where an artist name variation (anv, name with little asterisk\* after it) is used. These names can only be read in the link, and the link is URL Encoded.  
You can see that in the new version of my discogs script if you enable the DISCOGS\_ORIGINAL ...ARTIST NAME field(s). As I wrote, 921 replace lines just to get the "Basic Latin" set of characters.

By the way, the same thing your script has as %discogs\_artist\_name%. But you can't do that proper without decoding the links.
