Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to display apostrophe as part of text? (Read 4314 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to display apostrophe as part of text?

So I'm trying to abbreviate codec names to 3 letters and Monkey's Audio is giving me grey hairs. I tried to replace the apostrophe with unicode $char(39) as well as put apostrophes around the apostrophe but neither worked. Is there any workaround for this?

Here is the code I'm using:

$if($stricmp(%codec%,'Musepack'),'MPC',
$if($stricmp(%codec%,'Vorbis'),'OGG',
$if($strcmp(%codec%,'Monkey's Audio'),'APE',
%codec%)))

How to display apostrophe as part of text?

Reply #1
Quote
'
(single quotation mark)

Inserts specified text bypassing syntax processing; allows special characters such as %,$,[,] to be inserted. In order to insert a quotation mark character, use '' (two single quotation marks).

Strings enclosed in quotation marks are not processed, that's why $char(39) did not work.

Code: [Select]
$if($stricmp(%codec%,Musepack),MPC,
$if($stricmp(%codec%,Vorbis),OGG,
$if($stricmp(%codec%,Monkey''s Audio),APE,
%codec%)))

Shorter and probably faster according to a quick speed test:

Code: [Select]
$replace(%codec%,Musepack,MPC,Vorbis,OGG,Monkey''s Audio,APE)

How to display apostrophe as part of text?

Reply #2
I am surprised that this didnt work:
Code: [Select]
Monkey$char(39)s Audio
because it appears to work in every test I run on my end.

Oh it's because the whole thing was in quotes .. yea the first and last ' are causing the $ in $char() not to be processed.

I dont like mucking about with special characters so I'd suggest this:
Code: [Select]
$if($stricmp(%codec%,Musepack),MPC,
$if($stricmp(%codec%,Vorbis),OGG,
$if($stricmp(%codec%,Monkey$char(39)s Audio),APE,
%codec%)))

or something less messy than a cascading if like the replace option above.

How to display apostrophe as part of text?

Reply #3
Shorter and probably faster according to a quick speed test [...]

Is such a tool available for foobar? If so, where can I get it?


How to display apostrophe as part of text?

Reply #5
In Column Tab under Playlist View in ColumnUI settings in Preferences. You can find a Tools button there which open a menu and Speed Test is in it.

How to display apostrophe as part of text?

Reply #6
Thanks for the tips

 

How to display apostrophe as part of text?

Reply #7
Instead of %codec% why not use $ext(%path%) to get the three letter extension (except for .flac)?


This will not work for online streams and it will fall victim to any misnamed files while %codec% is a lot more versatile in it's implementation.