More > JRiver Media Center 30 for Windows

Expression "isrange" handling of accents / umlauts / ligatures

(1/2) > >>

CltrAltDel:
For a long time I've been using a pane view with (among others) a category/column "A-Z" for movies.
This uses the following expression for grouping:

if(isrange([name], a-z), formatrange([name],1,0), #)

which results in a column with "#ABC...Z" for filtering, so something like

#      -> 2 Guns | 2 Days in the Valley | 12 Monkeys | 2001: A Space Odyssey | ...
A      -> A Beautiful Mind | Ā La Carte! | Almost Famous | Ärger Im Gepäck | Atomic Blonde | ...
B      -> Babylon | Bad Santa | Barbarella | Barton Fink | ...
C      -> Car Wash | Casablanca | Casino | Chinatown | ...
...
Z      -> Zabriskie Point | Zero Effect | Zodiac | Zulu | ...

After the update to MC30 the column looks like this:

#            -> 2 Guns | 2 Days in the Valley | 12 Monkeys | 2001: A Space Odyssey | ...
(Others)   -> Ā La Carte! | Ärger Im Gepäck
A            -> A Beautiful Mind | Almost Famous | Atomic Blonde | ...
B            -> Babylon | Bad Santa | Barbarella | Barton Fink | ...
C            -> Car Wash | Casablanca | Casino | Chinatown | ...
...
Z            -> Zabriskie Point | Zero Effect | Zodiac | Zulu | ...

So umlauts and letters with accents are not handled like letters any more.
Interestingly, the ligature "Æ" is handled like a number, so the movie "Æon Flux" is sorted to "#" (should also go to "A"...).

Is this a bug or is it by design?
If it's by design, how to get around it?
I made some attempts with adding lines like

isequal([name], Ā), A,
isequal([name], Ä), A,

to the expression, but that does not seem to work.
As I'm not that savy with the expression language, some help would be greatly appreciated  :)

zybex:
This is not easy to do without a new function to remove diacritics from text (unicode normalization). Perhaps Matt can add a Normalize() function for that, or a new mode to the existing FixCase() function.

Then you would use something like this (if you have no names starting with symbols/punctuation):
Letter(normalize([name]),1,2)

Matt:
Look at Clean(...) in mode 9.

zybex:
Perfect :) That mode is not documented, apparently: https://wiki.jriver.com/index.php/String_Manipulation_Functions#Clean

Then it's just:
Letter(Clean([Name],9),1,2)

Matt:

--- Quote from: zybex on March 27, 2023, 11:13:55 am ---Perfect :) That mode is not documented, apparently: https://wiki.jriver.com/index.php/String_Manipulation_Functions#Clean

Then it's just:
Letter(Clean([Name],9),1,2)

--- End quote ---

Just updated.

Navigation

[0] Message Index

[#] Next page

Go to full version