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

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:

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)

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:

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.

This is not a bug, this is a feature.
See e.g. the help:
http://help.mp3tag.de/main_converter.html
or the HowTos:

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.

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: