Version: (using KDE KDE 3.4.0) Installed from: Gentoo Packages Compiler: GCC 3.3.3 OS: Linux Collection browser can filter songs according to space separated terms. The filter is supposed to be case-insensitive. The problem is that though the filter is case-insensitive for latin characters, it seems to be case-sensitive for cyrillic characters. I suspect this might generalize to any non-latin alphabet characters. I observed the bug with an April 23rd 2005 CVS build of amarok. The bug is there both with SQLite and MySQL (version 4.0.24) as backends. Amarok's playlist properly filters cyrillic song titles in a case-insensitive way. The case-insensitive filter in the playlist uses .lower() == .lower() approach. Collection browser, on the other hand, delegates the filtering to the database using LIKE operator, which is case-insensitive by default. I suspect the bug in the filter may be due to the way Amarok stores non-latin characters in the database.
Amarok stores data in the database in UTF-8 encoding. It turned out that MySQL did not support UTF-8 encoding before version 4.1. Thus, case-insensitive comparison operations (LIKE in this case) could not work properly with non latin1 characters. I've upgraded MySQL to 4.1.8 and configured it to use UTF-8 by default on the server side. Then, I modified amarok's code to tell MySQL that Amarok also uses UTF-8 encoding. Finally, I let Amarok create a new database. Everything works fine now. Collection browser does proper case-insensitive filtering for latin characters and for cyrillic characters. The only problem is that this fix works only for MySQL case and only if one uses MySQL 4.1+. --- There are two ways to make MySQL use UTF-8 on the server side: 1. Add two lines in /etc/mysql/my.cnf under [mysqld] section: character-set-server = utf8 collation-server = utf8_general_ci OR 2. Tell that Amarok's database uses UTF-8 explicitly, passing CHARACTER SET and COLLATE arguments to CREATE DATABASE or ALTER DATABASE. --- To tell MySQL that Amarok uses UTF-8 I added following code in MySqlConnection::MySqlConnection after mysql_init and before mysql_real_connect: if ( mysql_options( m_db, MYSQL_SET_CHARSET_NAME, QString("utf8").latin1() ) ) { error() << "Failed to set charset to utf8\n"; }
Collection Browser items are now properly sorted.
I notice the same bug with amarok 1.3.4 and sqlite 3.2.7 as backend.