How can I prevent Mp3tag messing with \\ in fields?
If on V2.49 I edit a field containing "\\", Mp3tag changes what I see to ", ".
I guess the program thought I wanted multiple values. But even then, it messes up - if I edit again, it concatenates the multiple values with ", " into a single value
chrisjj, at first I recommend reading this thread ... /t/11800/1
... then come back and we may discuss the "\\ double backslash problem" resp. the "built in multi-value functionality" from another point of view.
Do you want to use "\\" as literal characters?
Where do you see "\\" displayed as ", "? At the main window, in the tag panel, in the extended tags dialog, or in an external application?
That's a bit of a problem. Mp3tag is using "\\" as a syntax character which tells the programm to split the tag field. As far as I know, there is no proper way to escape that syntax function of "\\".
There are a few workarounds:
Mp3tag only splits the fields in these cases:
if the field is displayed at the the tag panel and you save the file
if you open the extended tag panel and leave it with pressing "OK"
if you click into the field at the main window
(for the first two cases, the fields are only splitted when all selected files have the same values)
If you can avoid those cases, you are fine.
If not, you can make an action to reverse the splitting:
Or you can do an regex replace action, to insert a zero width space between the the two characters. With this trick, the field looks like before, but it isn't splitted because there is an invisible character between the two "\\". But if you use that description field to be read by another application, there could be problems that the filepath you are storing there isn't recognized any more.
You have to do this before the fields are splitted. If you want to do it afterwards, merge the fields again an join that with using that zero width space, use:
Action: Format Value
Field: DESCRIPTION
Formatstring: $regexp($meta_sep(description,\\),\\,\\x{200B}\\)
The problem occurs when editing the field. You're suggesting avoiding all cases that edit the field, right?.
If not, you can make an action to reverse the splitting:
Action: Merge dublicate fields
That messes-up fields that weren't split by the first mess-up.
Or you can do an regex replace action, to insert a zero width space ... But if you use that
description field to be read by another application, there could be problems