Apostrophe in target file path causes export problem

Hi there, long-time MP3Tag fan and first post.

Using: Mp3tag v3.11 / Win7-64

Problem: File > Export. If the destination path for the export file contains an apostrophe in the names, there is still an export file created but it is in the current default directory with filename "[SYNTAX ERROR IN FORMATTING STRING]".

The problem goes away if I remove the apostrophe from the target destination path.

Other aspects of MP3Tag (eg reading tags) function correctly when there are apostrophes in the file paths.

The work-around is to avoid having apostrophes in the path to an export destination, but nonetheless this is a bug and had me scratching my head for a while.

Best regards

1 Like

How do you create the export filename?
I think that the apostrophes in format strings always either have to be replaced with 2 of them or removed alltogether as they otherwise enclose a literal string - and if that is missing the closing apostrophe, then you get a syntax error..

It's not the export filename I'm talking about, it's the file path. The path is chosen from the existing directory tree using the file system browser window.

But you're right: if I edit the "Export file name" box in the Export Configuration window (subsequent to selecting the export file in the file system browser) to "double up" the apostrophe in the path, it works.

Thanks for the work-around, but it's still a bug!

I agree - this is unexpected. You are requested to enter a filename, not a format string (although it is one).
You enter a text constant and it is treated like a variable string that needs processing.
I set the name mm'mm.txt
If the filename is set in $filename() and contains an apostrophe, you get the error message that the filename has a malformed parameter specification.
I tried this also mit mm'mm.txt
Fascinatingly, if the referenced data contains an apostrophe then there is no error.
With $filename(%title%.txt,utf-8) and TITLE = "Fishtrippin'", the file Fishtrippin'.txt is created without error.
The help for $filename() or the input field for the export filename does not state that in fact a Format string is used with all its rules and specifica.

I have no doubt what you say is correct, but it need not be as complicated as that.

By clicking the breadcrumb trail button to the right of the filename box, you get a browser to select destination folder and filename (if it exists). No need to enter anything, just point and click. The reason I discovered the fault is because I happen to have a folder "freddy's" in which I wanted to capture the export. It took some time for me to work out what was causing it.

I submit a user is more likely to be navigating by point-and-click than typing into the Export Configuration.

As there is no moratorium on apostrophes in folder and file names, MP3Tag really ought to accept them without having to manually escape apostrophes (or any other character valid in Windows paths).

1 Like

Indeed. I tried to support your observation.

1 Like

This is now fixed with Mp3tag v3.12a.

1 Like

Super, thank you very much.

1 Like

I am still experiencing this issue.

I am running v3.12a.

Using "Tag - Filename" with the format string "z:\Music\Jonathan's Music%albumartist%%track% - %title%" as the format string I still get "Syntax Error" as the result.

If you enter a string constant like "Jonathan's" in a format string, you have to escape the apostrophe.
You will not get an error from data with apostrophe as found in a field contents


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.