# Convert filename issue with escape characters in tag

**URL:** <https://community.mp3tag.de/t/convert-filename-issue-with-escape-characters-in-tag/17113>\
**Category:** Support\
**Created:** [July 31, 2015, 5:24pm UTC](https://community.mp3tag.de/t/convert-filename-issue-with-escape-characters-in-tag/17113 "2015-07-31T17:24:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![benme](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@benme](https://community.mp3tag.de/u/benme)\
**Post date:** [July 31, 2015, 5:24pm UTC](https://community.mp3tag.de/t/convert-filename-issue-with-escape-characters-in-tag/17113/1 "2015-07-31T17:24:01Z")

</div>

When 'Artist' (or I suspect any tag) includes a character like '/' AND you are using path separators ('') in the format string the output filename will get scrambled.

Example  
Artist: LSO / Sir Colin Davis  
Format string: m:\%artist%\%album%$num(%track%,2) - %title%

Will create (preview windows):  
"F:\Audio\downloads\0702tr-LSO-Colin-Davis-Haydn-Symphonies-92-and-93-FLAC16\0702tr-LSO-Colin-Davis-Haydn-Symphonies-92-and-93-FLAC 16\01. HAYDN Symphony No 92 01 Adagio - Allegro spiritoso.flac" -\>  
"F:\Audio\downloads\m\LSO Sir Colin Davis\HAYDN Symphonies Nos 92 & 93\01 - 1. HAYDN Symphony No 92 i Adagio - Allegro spiritoso.flac"

instead of the expected:  
"m:\LSO Sir Colin Davis\HAYDN Symphonies Nos 92 & 93\01 - 1. HAYDN Symphony No 92 i Adagio - Allegro spiritoso.flac"

Note: this will possible be an issue with oither escape charavcters as well ( ';"{ ) togh I have not tested this.

---

<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:** [July 31, 2015, 5:29pm UTC](https://community.mp3tag.de/t/convert-filename-issue-with-escape-characters-in-tag/17113/2 "2015-07-31T17:29:52Z")

</div>

Have you tried to enclose the conversion mask into the function  
$validate()  
And see what the result is?

---

<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:** [August 1, 2015, 1:00am UTC](https://community.mp3tag.de/t/convert-filename-issue-with-escape-characters-in-tag/17113/3 "2015-08-01T01:00:05Z")

</div>

> [@benme](#):
>
> When 'Artist' (or I suspect any tag) includes a character like '/' AND you are using path separators ('') in the format string the output filename will get scrambled. ... Example Artist: LSO / Sir Colin Davis

There is a problem with the forbidden slash character "/" within the assembled filepathname.  
You can try this ...

 **With ARTIST = 'LSO / Sir Colin Davis' ... $validate('m:\'%ARTIST%'\'%ALBUM%'\'$num(%TRACK%,2)' - '%TITLE%,'\_') ==\> 'm:\LSO \_ Sir Colin Davis\...' $validate('m:\'%ARTIST%'\'%ALBUM%'\'$num(%TRACK%,2)' - '%TITLE%,) ==\> 'm:\LSO Sir Colin Davis\...' $replace('m:\'%ARTIST%'\'%ALBUM%'\'$num(%TRACK%,2)' - '%TITLE%,' / ',' ') ==\> 'm:\LSO Sir Colin Davis\...'**

If you don't want to rely on the Mp3tag function $validate(), ...  
then you may apply your own function ...

**$regexp(your\_filename\_ext,'[\x3A\x2A\x3F\x5C\x2F\x22\x3C\x3E\x7C\0-\x1F]','\_') $regexp(your\_folderpath,'[\x22\x3C\x3E\x7C\0-\x1F]','\_') ... or ... including slash character / ... $regexp(your\_folderpath,'[\x2F\x22\x3C\x3E\x7C\0-\x1F]','\_')**

DD.20150801.1148.CEST

---

<div class="post-metadata">

**Author:** ![benme](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@benme](https://community.mp3tag.de/u/benme)\
**Post date:** [August 6, 2015, 2:47pm UTC](https://community.mp3tag.de/t/convert-filename-issue-with-escape-characters-in-tag/17113/4 "2015-08-06T14:47:35Z")

</div>

> [@DetlevD](#):
>
> There is a problem with the forbidden slash character "/" within the assembled filepathname.  
> You can try this ...  
> [size=1][font="Courier New"][b]
> 
> With ARTIST = 'LSO / Sir Colin Davis' ...
> 
> DD.20150801.1148.CEST

Thanks!  
Seems there is much more to MP3tag then the eye meets at first sight...  
Got it working now.

---

<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:25pm UTC](https://community.mp3tag.de/t/convert-filename-issue-with-escape-characters-in-tag/17113/5 "2026-02-09T12:25:48Z")

</div>

Closed on February 9, 2026, 12:25pm UTC


