# \[X\] $caps2() Bug

**URL:** https://community.mp3tag.de/t/x-caps2-bug/16559
**Category:** No Bugs
**Created:** [February 3, 2015, 1:31am UTC](https://community.mp3tag.de/t/x-caps2-bug/16559 "2015-02-03T01:31:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [February 3, 2015, 1:31am UTC](https://community.mp3tag.de/t/x-caps2-bug/16559/1 "2015-02-03T01:31:57Z")

</div>

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.

---

<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: [February 3, 2015, 5:30am UTC](https://community.mp3tag.de/t/x-caps2-bug/16559/2 "2015-02-03T05:30:19Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [February 3, 2015, 6:15am UTC](https://community.mp3tag.de/t/x-caps2-bug/16559/3 "2015-02-03T06:15:38Z")

</div>

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._

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [March 14, 2015, 7:57am UTC](https://community.mp3tag.de/t/x-caps2-bug/16559/4 "2015-03-14T07:57:51Z")

</div>

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

Kind regards  
Florian

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 14, 2015, 4:28pm UTC](https://community.mp3tag.de/t/x-caps2-bug/16559/5 "2015-03-14T16:28:17Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [March 15, 2015, 7:29am UTC](https://community.mp3tag.de/t/x-caps2-bug/16559/6 "2015-03-15T07:29:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [December 28, 2018, 2:35pm UTC](https://community.mp3tag.de/t/x-caps2-bug/16559/7 "2018-12-28T14:35:46Z")

</div>

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