# Function for urlencode?

**URL:** https://community.mp3tag.de/t/function-for-urlencode/13204
**Category:** General Discussion
**Created:** [March 11, 2012, 2:04pm UTC](https://community.mp3tag.de/t/function-for-urlencode/13204 "2012-03-11T14:04:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Flashin\_39\_95](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/5fc32e/32.png) [@Flashin\_39\_95](https://community.mp3tag.de/u/Flashin_39_95)
#### Post date: [March 11, 2012, 2:04pm UTC](https://community.mp3tag.de/t/function-for-urlencode/13204/1 "2012-03-11T14:04:52Z")

</div>

Hi, I want to pass Text to a URL that fills a form on a website.

To build the URL I need to urlencode the text. Is there a function for it? If not, why not? It's 2012, people do stuff online 😉

I found this topic [/t/11477/1](https://community.mp3tag.de/t/11477/1) where someone wrote a manual urldecoding list. That seems like a very bad solution which could easily be solved by adding urlencode functionality. Javascript's encodeURIComponent would also work if linebreaks are replaced to \n.

---

<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: [March 11, 2012, 3:28pm UTC](https://community.mp3tag.de/t/function-for-urlencode/13204/2 "2012-03-11T15:28:59Z")

</div>

Use  
[Encoding]=url

in the script and Mp3tag url encodes the url it requests.

---

<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: [March 11, 2012, 4:22pm UTC](https://community.mp3tag.de/t/function-for-urlencode/13204/3 "2012-03-11T16:22:21Z")

</div>

**[Encoding]=url** does only work for web sources.  
Flashin '95 is planning to use Mp3tag's export for this (as I know from some advice I have given him before). So this post landed in the wrong forum section.

The goal in this project is to export **.url files** which open a web page with a fill-in form. This form should be filled automatically with values from one or more mp3 files via an url parameter.  
The **$loop()** function of Mp3tag's export is neccessary, because this should work for more than one file.

We would need a function like **$endcode(%fieldname%,url)** here to do it propper, otherwise we would have to build long constructions like **$replace(%fieldname%,?,'%3F',=,'%3D',&,'%26', ,'%20')** and regex like **$regexp(%fieldname%,\r\n,'%0A')**.
