[X] $caps2() Bug

I have the following action:

Action type: Format value
Field: TITLE
Format string: $caps2(%title%,'([{,"')

And a TITLE field containing:

Alive and well

But it's not capitalizing the first letter of words following a space. I expect it to return:

Alive And Well

I'm pretty certain this worked previously. An easy workaround is to add a space to the "additional characters" parameter, but it shouldn't be necessary.

I only have case-action with the space character in the list.
As soon as you add the second parameter, you have to supply the complete list.
This is the behaviour I found over the years, I can see no bug.

Ok, I see now that you're correct. I must have changed the action group without remembering that I had done so. An older backup of Mp3tag shows that I was previously using $caps2() without the second parameter.

I would suggest, however, that the documentation is incorrectly worded. The second parameter does not specify additional characters that trigger the case change. Apparently, it specifies all of them. For English I would suggest the following change to the wording for each of the case conversion examples:

Change

The second parameter is optional and specifies additional characters that trigger upper case.

to

The optional second parameter specifies the characters that trigger upper case.

That's correct. I'll update the documentation as you suggested.

Kind regards
Florian

Are the results from these examples correct?

$caps2('aaa bbb cCc ddD',' ') ==> "Aaa Bbb CCc DdD" $caps2('aaa bbb cCc ddD',' bd') ==> "Aaa bbb CCc ddD" $caps2('aaa bbb cCc ddD',' b') ==> "Aaa bbb CCc DdD"

DD.20150314.1828.CET

Yes, this is how it's implemented. Basically, separators are not subject for capitalization -- but the character after the separator, as long it's not a separator.

Kind regards
Florian

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