Searching titles and artists with accents and diacritics doesn't work

Bug #1980944 reported by Paolo Cantarella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Committed
Medium
Daniel Schürmann

Bug Description

Mixxx version: 2.3.3
OS version: MacOS 12.4

I have a lot of files with accents and diacritics (Spanish songs) and this causes some problems when searching them (I don't have the same characters in my keyboard). What's really strange is that I can't even find a track copying and pasting the exact title it has in the mp3 tags.

A possible solution: each searchable field (title, artist, genre...) could be duplicated in the database with an ASCII only version, for example:

title: Buscándote
title_ascii: buscandote

The original field is used for display while the ASCII one is used for search.

To convert a string to its ASCII can be done normalizing the unicode characters to NFD (https://en.wikipedia.org/wiki/Unicode_equivalence#Normal_forms) and then strip away all marks and diacritics. The same should be done to the string entered in the search field.

Example in Java: https://stackoverflow.com/questions/2397804/java-string-searching-ignoring-accents/2397830#2397830

Tags: library macos
Revision history for this message
ronso0 (ronso0) wrote :

I can't reproduce on Linux with Mixxx 2.3.4

I tried both with the file name and title tag and could find it both with "Buscándote" and "Buscandote".

So this is a macOS issue?

Revision history for this message
Paolo Cantarella (pcantare) wrote :

I have Mixxx 2.3.3. Not sure if in 2.3.4 it might have been fixed.

As for MacOS, I'm pretty sure the file system uses NFD normalization format rather than NFC, so searching the file name might get wrong result: https://medium.com/@sthadewald/the-utf-8-hell-of-mac-osx-feef5ea42407

I find it strange anyway that searching the title in the mp3 tags gets different results in different OS's. The tags in my mp3s are normalized as NFC.

Revision history for this message
ronso0 (ronso0) wrote :
Revision history for this message
Daniel Schürmann (daschuer) wrote :

We use a likeCompareLatinLow() function that replaces all special characters with their Latin replacements before compare. It sounds like this is not working on your device.
https://github.com/mixxxdj/mixxx/blob/a5906c1d9c067e5b181f889bb4471dbece5842fc/src/util/db/dbconnection.cpp#L386

Did you use the official Mixxx build?

Revision history for this message
Paolo Cantarella (pcantare) wrote :

I use the official Mixxx build (2.3.3) and I also downloaded the source files and built it. This morning I was actually prying into that file.

Revision history for this message
Paolo Cantarella (pcantare) wrote :

Actually it looks like the function likeCompareLatinLow() is not called when the search is performed. I added a few couts in the funcion and nothing is printed. Anyway, I could see that makeLatinLow() is called instead, but I don't know from where.

Changed in mixxx:
status: New → Confirmed
milestone: none → 2.3.4
importance: Undecided → Medium
Revision history for this message
Daniel Schürmann (daschuer) wrote :

I have confirmed here:
https://github.com/daschuer/mixxx/actions/runs/2670031391
That the code is skiped.
I can remember that we had issues to verify that Qt uses the same SQLite library than Mixxx would use. Because of crashers in case this is not the case we have disabled the code.

I assume everything is working with 2.4 alpha. So I suggest to use that, after some brief tests.
Backup your library, before installing 2.4 just in case ..

tags: added: library macos
Changed in mixxx:
assignee: nobody → Daniel Schürmann (daschuer)
milestone: 2.3.4 → 2.4.0
status: Confirmed → Fix Committed
Revision history for this message
Paolo Cantarella (pcantare) wrote :

Thank you very much. I have the source code of 2.3.3. Is there a way I can enable this behaviour in this version as well?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

You can enable LOCALAWARECOMPARE like described here:
https://github.com/mixxxdj/mixxx/blob/6dea2f3de76908841be1a8bc4aa07dae39633a97/CMakeLists.txt#L2500

This works only if Qt links to the same SQLite binary as Mixxx.

Revision history for this message
Paolo Cantarella (pcantare) wrote :

Thank you. It works!

Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/10781

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.