# V2.95 - Tag -\> Filename mistreats "\\" in tags

**URL:** https://community.mp3tag.de/t/v2-95-tag-filename-mistreats-in-tags/45558
**Category:** No Bugs
**Created:** [May 28, 2019, 7:05pm UTC](https://community.mp3tag.de/t/v2-95-tag-filename-mistreats-in-tags/45558 "2019-05-28T19:05:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Flugschwein](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flugschwein/32/6545_2.png) [@Flugschwein](https://community.mp3tag.de/u/Flugschwein)
#### Post date: [May 28, 2019, 7:05pm UTC](https://community.mp3tag.de/t/v2-95-tag-filename-mistreats-in-tags/45558/1 "2019-05-28T19:05:09Z")

</div>

# V2.95 - Tag -\> Filename mistreats "" in tags

When using the Tag - Filename feature, it does not handle backslashes correctly. In the following examples `$ifgreater($num(%discnumber%,1), $num(0, 1), $num(%discnumber%, 1) - ,)$num(%track%,2). %title%` will be used as the Format String, and the following filetree will be assumed:

```auto
Artist
├── Album 1
│ ├── 01. Erster Song.flac
│ ├── ...
│ └── 12. Letzter Song.flac
└── Album 2
    ├── 01. First Song.flac
    ├── ...
    ├── 05. Bugged Song.flac
    ├── ...
    └── 14. Last Song.flac

```

The bugged song will have `foo\bar` as its title.

The current directory will be Artist

#### Expected behavior

Mp3tag ignores the backslash and renames the files the following way: (it handles the backslash the same way it handles a normal slash)

```auto
Artist
├── Album 1
│ ├── 01. Erster Song.flac
│ ├── ...
│ └── 12. Letzter Song.flac
└── Album 2
    ├── 01. First Song.flac
    ├── ...
    ├── 05. foobar.flac
    ├── ...
    └── 14. Last Song.flac

```

#### Actual behavior

Mp3tag does **not** ignore the backslash, and instead makes some rather weird naming:

```auto
Artist
├── 05. foo
│ ├── bar.flac
├── Album 1
│ ├── 01. Erster Song.flac
│ ├── ...
│ └── 12. Letzter Song.flac
└── Album 2
    ├── 01. First Song.flac
    ├── ...
    ├── ...
    └── 14. Last Song.flac

```

#### How to reproduce

1. Take an example song and change its title (or some other property you later specify as content of the Format String) to include a backslash (`\`)
2. Click on the `Tag - Filename` icon while the example song is selected, and click on OK. (Make sure your Format String uses the Tag you edited in point 1) Wait a second and look at the output.

Small notice: in the preview the filename gets displayed correctly.

---

<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: [May 28, 2019, 7:08pm UTC](https://community.mp3tag.de/t/v2-95-tag-filename-mistreats-in-tags/45558/2 "2019-05-28T19:08:46Z")

</div>

This is not a bug, this is a feature.  
See e.g. the help:

> **[Converters – Mp3tag Documentation](https://docs.mp3tag.de/converters/)**
>
> Converters. Mp3tag is the universal Tag Editor.

or the HowTos:

> [@Converters to rename files or to import tags](https://community.mp3tag.de/t/converters-to-rename-files-or-to-import-tags/8016):
>
> Mp3tag provides a variety of possibilities to get tag information from parts of the filename or rename files based on the information stored in the tag of a file. The base concept behind all converters in Mp3tag is the so called format string, which describes a pattern (or template) of a filename or a line in a tag-list file. A format string consists of any characters and predefined placeholders or scripting functions. Every placeholder begins with the percent sign %, followed by a tag field n…

---

<div class="post-metadata">

### Author: ![Flugschwein](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flugschwein/32/6545_2.png) [@Flugschwein](https://community.mp3tag.de/u/Flugschwein)
#### Post date: [May 28, 2019, 7:23pm UTC](https://community.mp3tag.de/t/v2-95-tag-filename-mistreats-in-tags/45558/3 "2019-05-28T19:23:25Z")

</div>

I'm not sure you understood my bug report. What my report is about backslashes in the **tags** being interpreted as if they were in the **format string**. I'm pretty sure that shouldn't be the case. I'm well aware that backslashes can be used as a feature in the format strings.

---

<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: [May 28, 2019, 7:44pm UTC](https://community.mp3tag.de/t/v2-95-tag-filename-mistreats-in-tags/45558/4 "2019-05-28T19:44:41Z")

</div>

In the end, MP3tag hands over the composed string to the OS and that creates the folder.  
You cannot create a filename with a backslash.  
So it is no MP3tag bug but a feature.  
If you do not want to include the backslash of a tag field in the filename, then you could enclose the troublesome fields in a scripting function $replace() that replaces the backslash with something else.

See also this thread:

> [@\[X\] possible mishandling of backslashes in tags](https://community.mp3tag.de/t/x-possible-mishandling-of-backslashes-in-tags/8822):
>
> Problem description: "Tags to filename" function creates folders when tags contain a \ (backslash) Example: artist: yyy title: zzz\zzz Using the "tag to filename" option with a "%artist%-%title%" format-string - I'd expect the resulting file to be named "yyy-zzz\zzz.mp3" Due to restrictions in the file system, this filename is impossible to create. the "yyy-zzz" part will always be interpreted as a folder containing a file called "zzz.mp3". As a result, instead of renaming the file, the …

---

<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:19pm UTC](https://community.mp3tag.de/t/v2-95-tag-filename-mistreats-in-tags/45558/5 "2026-02-09T12:19:08Z")

</div>


