# Export options not enconding correcly

**URL:** <https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436>\
**Category:** Support\
**Created:** [February 5, 2019, 9:35pm UTC](https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436 "2019-02-05T21:35:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)\
**Post date:** [February 5, 2019, 9:35pm UTC](https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436/1 "2019-02-05T21:35:28Z")

</div>

In my export configuration, I'm already using the `$filename(test.txt,utf-8)` format. But all functions, like $replace(%track%), are exporting "&" as "& amp;".

I've tried to change the coding to 16 or ANSI, but didn't work.

Am I missing something?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [February 6, 2019, 5:54am UTC](https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436/2 "2019-02-06T05:54:48Z")

</div>

You would have to show us more of the export script.

> [@henriquebs12](#):
>
> $replace(%track%)

Is at least dubious syntax as it does not replace anything and I wonder where you find and ampersand in TRACK.

---

<div class="post-metadata">

**Author:** ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)\
**Post date:** [February 6, 2019, 8:40pm UTC](https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436/3 "2019-02-06T20:40:06Z")

</div>

It is exporting to be used as HTML

```
$filename(Table %album%.txt,utf-8)
    <center>
    <table cellpadding="0" cellspacing="0">
    <tbody>
    <tr><th>Nº&nbsp;</th>
    <th>Name</th>
    <th>Artist</th></tr>
    $loop(%_filename_ext%)
    <tr$if($odd($add(%_counter%,1)), class="even",)>
          <td>$replace(%track%)</td>
          <td>$replace(%title%)</td>
          <td>$replace(%artist%)</td></tr>
    $loopend()
    </tbody></table>
```

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [February 6, 2019, 8:47pm UTC](https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436/4 "2019-02-06T20:47:19Z")

</div>

As I said:

> [@henriquebs12](#):
>
> \<td\>$replace(%track%)\</td\>

is more or less invalid syntax and leads in fact to an empty output.  
In fact, the only thing that you get is:  
`

  
  
  
  

```
<tr>
      <td></td>
      <td></td>
      <td></td></tr>

</tbody></table>`

```

So in short: I cannot reproduce your initial post. You would have to show the data that leads to the effect. (But I still think that the invalid $replace() spoils it all)

| Nº&nbsp; | Name | Artist |
| --- | --- | --- |

---

<div class="post-metadata">

**Author:** ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)\
**Post date:** [February 6, 2019, 10:39pm UTC](https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436/5 "2019-02-06T22:39:12Z")

</div>

Actually my loop is

```
$loop(%_filename_ext%)
<tr$if($odd($add(%_counter%,1)), class="even",)>
      <td>$replace(%track%,&,&amp;)</td>
      <td>$replace(%title%,&,&amp;)</td>
      <td>$replace(%artist%,&,&amp;)</td></tr>
$loopend()

```

But I don't remember what does `&,&amp;` mean, because I wrote it long time ago. But even writing only (%track%) will produce `&amp; amp;` instead of & in the exported txt file.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [February 7, 2019, 5:55am UTC](https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436/6 "2019-02-07T05:55:03Z")

</div>

> [@henriquebs12](#):
>
> I don't remember what does `&,&amp;` mean, because I wrote it long time ago

It is probably intended to get some kind of html transcription for html meta characters.  
the ampersand indicates special functions in html and so if you want to get a visible character, you have to use the transcription.  
See e.g.

> **[How to use ampersands in HTML: to encode or not to encode? - Peter Coles](https://mrcoles.com/blog/how-use-amersands-html-encode/)**
>
> An explanation of when to use encoded ampersands (&) in HTML and Javascript and when not to encode them.

Yet, I tried that loop and it replaces a single ampersand with `&amp;` as intended.  
So what is the problem?

PS:  
The list of problematic characters is by far not complete with just the ampersand.

- ä -\> &auml;
- Ä -\> &Auml;
- ö -\> &ouml;
- Ö -\> &Ouml;
- ü -\> &uuml;
- Ü -\> &Uuml;
- ß -\> &szlig;
- € -\> &euro;
- & -\> &amp;
- \< -\> &lt;
- \> -\> &gt;
- „ -\> &quot;
- © -\> &copy;
- • -\> &bull;
- ™ -\> &trade;
- ® -\> &reg;
- § -\> &sect;

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:27pm UTC](https://community.mp3tag.de/t/export-options-not-enconding-correcly/44436/7 "2026-02-09T12:27:54Z")

</div>


