Bug 10114 - Incorrect sort order for int. characters
: Incorrect sort order for int. characters
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Display
: 7.2.1
: PC Windows XP
: -- normal (vote)
: 7.3.3
Assigned To: Michael Herger
http://dev.mysql.com/doc/refman/5.0/e...
: charset_issues
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-24 03:52 UTC by vagskal
Modified: 2010-12-10 02:28 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vagskal 2008-11-24 03:52:26 UTC
1. Artists and Albums containing "Swedish" characters (åäöÅÄÖ) are not sorted correctly in the web UI, using Fishbone, (or on the Controller or the SB3 display). They are sorted as if the "umlaut" - i.e. the dots or circle - did not exist. They should be sorted last.

2. In Artist and Album view in the web UI, using Fishbone, those characters do not appear in the alphabetic list on top (although I have albums and artists which start with those characters). When browsing Artist / Various Artists those characters do appear correctly (at the end of the alphabet) in the alphabetic list on top (but using the link from them will get you to their "naked" equivalent, i.e. the link for Ä will take you to A).

Below are my details:
SqueezeCenter-version: 7.2.2 - 23974 @ Sat Nov 22 02:02:33 PST 2008 - Windows XP - SV - cp1252
Serverns IP-adress: 192.168.1.4
Perl-version: 5.8.8 MSWin32-x86-multi-thread
MySQL-version: 5.0.22-community-nt 

I am using Swedish XP with Swedish keyboard layout. The language in SC and on the Controller is set to Swedish ("Svenska"). I use the Fishbone skin. I have the Custome Browse plugin installed.
Comment 1 James Richardson 2008-11-24 07:43:19 UTC
Vaqskal

Does the same thing happen with the Default skin?
Comment 2 vagskal 2008-11-24 09:18:07 UTC
(In reply to comment #1)
> Vaqskal
> Does the same thing happen with the Default skin?

Yes, I have tested that now.
Comment 3 Chris Owens 2008-11-24 10:31:33 UTC
QA to try to reproduce.  Andy notes that this has been fixed in the past; Mysql requires a special swedish setting, but this is done if the server is set to swedish.  Related to bug 5443.
Comment 4 vagskal 2008-11-24 11:08:45 UTC
(In reply to comment #3)
> QA to try to reproduce.  Andy notes that this has been fixed in the past; Mysql
> requires a special swedish setting, but this is done if the server is set to
> swedish.  Related to bug 5443.

Yes, I am quite sure it has worked in the past, but I cannot tell exactely when it was broken again (perhaps when I uppdated to 7.2.2 nightly recently?).
Comment 5 vagskal 2008-11-30 01:38:51 UTC
The behaviour persists after updating to latest 7.3 nightly.

Below are the details after the update:
SqueezeCenter-statusVersion: 7.3 - 24151 @ Sat Nov 29 03:01:22 PST 2008

Värdnamn: Musikmaskinen

Serverns IP-adress: 192.168.1.4

HTTP-serverns portnummer: 9000

Operativsystem: Windows XP - SV - cp1252 

Plattformsarkitektur: 586

Perl-version: 5.8.8 - MSWin32-x86-multi-thread

MySQL-version: 5.0.22-community-nt

Totalt antal anslutna spelare: 4

Comment 6 vagskal 2008-11-30 01:44:16 UTC
I might add that the "Swedish" characters (åäöÅÄÖ) do not show up at all on the scroll wheel on the Controller (7.3 r3437). (I, however, cannot remember that they have ever shown up there.)
Comment 7 Michael Herger 2008-12-18 00:40:47 UTC
A swedish user sent me the following comment:

"The version 7.2 SqueezeCenter sort the Swedish letters in the correct
alphabetic order, ABC…O…..ZÅÄÖ. The three latter is a Swedish “specialty”
only shared with other Nordic countries (and Ö with Germany)  J
 
In the last version (7.3) your program sort the letters (in music folder for
instance) in order AÄÅ………OÖ…Z. For example, the three artists “Pojkar”,
“Police” and “Pökhus” should be in this order (and is in ver 7.2) but now
comes in order “Pojkar”, “Pökhus” and “Police”. This is incorrect and rather
irritating."

Andy - didn't we add some code to handle nordic languages differently? I thought there was some change on the DB level.
Comment 8 Andy Grundman 2008-12-18 05:58:00 UTC
OK, what probably happened was that schema_8_up was run on upgrading to 7.3, and it changed the collate on all tables to utf8_general_ci.

To fix the problem, try this:
Go to Settings.
Change language to English.
Change language back to Swedish.

That should reset the collate values for the database.
Comment 9 James Richardson 2008-12-21 16:49:53 UTC
*** Bug 10413 has been marked as a duplicate of this bug. ***
Comment 10 Moonbase 2008-12-22 01:12:56 UTC
I think there must be a "general" solution to this problem since people tend to have albums/artists/bands... from many countries nowadays.

I agree very much to let the database handle the collation (if possible), putting the actual "work" where it belongs. Also I think switching the collation to whatever "home language" a user has selected is a good idea. (Though bad for me, since I prefer English but live in Germany and kinda got used to the German collation sequence. Adding an extra "database collation" selector would add to the complexity, so I can live without.)

Is it done this way already? Reading Andy's comment I think the answer is "yes"?

Still there is a problem with this "getting rid of accents" logic: Even if displaying "É" as an extra letter at the end (SC set to English), the "E" shouldn't be missing. It confuses reading "A B C D F ..." and finding all albums starting with "E" under "É".

It might be nice to be able to SEARCH for "Équinoxe" by lazily typing "equinox" but I think for display and sorting purposes it's a bad idea trying to handle that manually in the code. Some accented letters in some languages sort like "the main letter without accent" whereas some have their own place in the alphabet, like in nordic languages, Dutch, German, etc. Every country has its own sorting rules, Germany has even two: (ä,ö,ü,ß=a,o,u,ss or ä,ö,ü,ß=ae,oe,ue,ss), Swedish uses ...z,å,ö,ü and ü=y and so on. How would we sort Thai? Chinese? Japanese? Russian? Polish? ...

Without having collation tables for each and every language, we should just let the database do it (a good database usually has collation rules), display "as returned", but still use some logic for "easy entry" into search forms.

So for my bug 10413 for example, I'd expect it to return "A B C D E F ... É" or maybe even "A B C D E É F ...".

Did anyone ever check out mySQL's "utf8" collation? If this was sorted like UTF16 or UTF32 where more "exotic" languages usually have their own range, it might help.
Comment 11 Ross Levine 2008-12-22 16:17:46 UTC
Validated this bug. Å is sorted at the top of my list (tracks), when it should be sorted after Z. 
Comment 12 vagskal 2008-12-23 00:41:19 UTC
(In reply to comment #8)
> OK, what probably happened was that schema_8_up was run on upgrading to 7.3,
> and it changed the collate on all tables to utf8_general_ci.
> 
> To fix the problem, try this:
> Go to Settings.
> Change language to English.
> Change language back to Swedish.
> 
> That should reset the collate values for the database.
> 

This fixed it for me in the web UI on 7.3.1 - 24324.

A change of language on the controller (FW 7.3 r3476) as suggested and thereafter a restart did, however, not fix the problem with sorting or the missing characters on the wheel on the controller.
Comment 13 Michael Herger 2009-01-06 00:40:56 UTC
Ross - is your last comment with or without the change Andy proposed?
Comment 14 Ross Levine 2009-01-06 14:00:14 UTC
(In reply to comment #13)
> Ross - is your last comment with or without the change Andy proposed?
> 

I apologize. My last comment was without the change Andy proposed. Switching the language as Andy suggests fixes the sort order in my test. 
Comment 15 Michael Herger 2009-01-06 23:24:30 UTC
> I apologize. My last comment was without the change Andy proposed. Switching
> the language as Andy suggests fixes the sort order in my test. 

Can you reproduce comment #12?
Comment 16 Ross Levine 2009-01-08 18:23:48 UTC
(In reply to comment #12)
> A change of language on the controller (FW 7.3 r3476) as suggested and
> thereafter a restart did, however, not fix the problem with sorting or the
> missing characters on the wheel on the controller.

I can't reproduce this. When I switch the language to Swedish on my Controller, the Swedish characters are sorted properly. They are sorted incorrectly until I switch the language. 
Comment 17 Michael Herger 2009-01-08 22:17:02 UTC
Then we can consider this fixed? Thanks!
Comment 18 Ross Levine 2009-01-09 11:28:23 UTC
Thank you Michael!
Comment 19 vagskal 2009-01-10 05:06:40 UTC
Sorry for being persistent.

I concur that the sort order is now fixed on the Controller as well.

But the Swedish characters do not appear at all on the typing wheel on the Controller (at least in the wheels used for searching artists and the wheel for setting the player name). I did another change of language on the Controller as suggested and thereafter a restart. I am now on FW 7.3 r3692.

Should the wheel issue perhaps be entered as a separate bug for it to be addressed (since it is not related to the sort order)?
Comment 20 Michael Herger 2009-01-10 07:49:19 UTC
Thanks for the feedback!

> Should the wheel issue perhaps be entered as a separate bug for it to be
> addressed (since it is not related to the sort order)?

Feel free to do so (if it doesn't exist yet). But you know that you can use the transcript (or whatever it's called) for those characters: o instead of ö etc.
Comment 21 vagskal 2009-01-11 04:49:06 UTC
(In reply to comment #20)
> > Should the wheel issue perhaps be entered as a separate bug for it to be
> > addressed (since it is not related to the sort order)?
> 
> Feel free to do so (if it doesn't exist yet). But you know that you can use the
> transcript (or whatever it's called) for those characters: o instead of ö etc.
> 

Thanks for the reply.

I filed a separate bug report, Bug# 10650.
Comment 22 James Richardson 2009-06-17 09:35:47 UTC
This bug has been fixed in the 7.3.3 release version of SqueezeCenter!

If you haven't already. please download the new version from http://www.logitechsqueezebox.com/support/download-squeezecenter.html 

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 23 vagskal 2010-07-23 05:43:01 UTC
(In reply to comment #0)
> 1. Artists and Albums containing "Swedish" characters (åäöÅÄÖ) are not
> sorted correctly in the web UI, using Fishbone, (or on the Controller or the
> SB3 display). They are sorted as if the "umlaut" - i.e. the dots or circle -
> did not exist. They should be sorted last.
> 
> 2. In Artist and Album view in the web UI, using Fishbone, those characters do
> not appear in the alphabetic list on top (although I have albums and artists
> which start with those characters). When browsing Artist / Various Artists
> those characters do appear correctly (at the end of the alphabet) in the
> alphabetic list on top (but using the link from them will get you to their
> "naked" equivalent, i.e. the link for Ä will take you to A).
> 
> Below are my details:
> SqueezeCenter-version: 7.2.2 - 23974 @ Sat Nov 22 02:02:33 PST 2008 - Windows
> XP - SV - cp1252
> Serverns IP-adress: 192.168.1.4
> Perl-version: 5.8.8 MSWin32-x86-multi-thread
> MySQL-version: 5.0.22-community-nt 
> 
> I am using Swedish XP with Swedish keyboard layout. The language in SC and on
> the Controller is set to Swedish ("Svenska"). I use the Fishbone skin. I have
> the Custome Browse plugin installed.

I am afraid that this issue is back again with 7.5.2 - r31077. My setup is otherwise the same.

I am now only using the default skin and this time the Artist / Various Artists menu behaves the same as the Artist and Album views, i.e. the "Swedish" characters (åäöÅÄÖ) are not sorted last and they do not appear in the alphabetic list on top. Otherwise the symptoms are the same.

The cure is also the same: Switch language to English and switch back to Swedish.
Comment 24 vagskal 2010-07-23 05:45:10 UTC
Oh, have to write a comment to reopen the bug report. The actual comment is above.
Comment 25 vagskal 2010-07-26 09:17:39 UTC
The cure for this bug (switching language) seems to have invoked bug #15116 and I get a lot of error messages like this one:

[10-07-25 21:23:29.2346] Slim::Schema::Storage::throw_exception (82) Error: DBI Exception: DBD::mysql::st execute failed: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_swedish_ci,IMPLICIT) for operation '=' [for Statement "UPDATE tracks_persistent,track_statistics set tracks_persistent.rating=track_statistics.rating where tracks_persistent.url=track_statistics.url and track_statistics.rating>0 and (tracks_persistent.rating!=track_statistics.rating or tracks_persistent.rating is null)"]
Comment 26 Alan Young 2010-12-10 02:28:39 UTC
I closing this on the basis that the original problem was indeed fixed. A new problem has since arisen (with much the same symptoms) and this deserves a new bug. I suggest that bug 13600 is the appropriate place to follow up with this.