Bug 10744 - International characters sorted wrong when browsing Music Folder
: International characters sorted wrong when browsing Music Folder
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Localization
: 7.5.x
: PC Windows XP
: -- minor (vote)
: 7.3.3
Assigned To: Michael Herger
: charset_issues
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-18 01:47 UTC by vagskal
Modified: 2010-12-10 02:38 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
Patched executable to support localized sort in Browse Music Folder (8.62 MB, application/x-msdownload)
2009-01-22 04:19 UTC, Michael Herger
Details
new build removing our file name normalization (8.62 MB, application/octet-stream)
2009-01-23 08:50 UTC, Michael Herger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vagskal 2009-01-18 01:47:14 UTC
When browsing the Music Folder in the web UI in SC, on the Controller (FW 7.3 r3698), SB3 (FW 122) and Boom (FW 42) the "Swedish" characters ÅÄÖåäö are not sorted correctly, i.e. they do not come last in the list.

I am running SC 7.3.2 - 24612 @ Sat Jan 10 03:02:29 PST 2009, Operativsystem: Windows XP - SV - cp1252, Plattformsarkitektur: 586, Perl-version: 5.8.8 - MSWin32-x86-multi-thread, MySQL-version: 5.0.22-community-nt.

The language in SC and on the players is set to Swedish (Svenska). I have tried switching languages back and forth as suggested in Bug# 10114.

SC is running on Swedish Win XP and the Music Folder is also on a PC running Swedish Win XP.
Comment 1 Michael Herger 2009-01-18 13:59:30 UTC
Just to be sure: they are displayed correctly, but in the wrong order. And this happens in Browse Music Folder only?
Comment 2 vagskal 2009-01-19 04:16:38 UTC
(In reply to comment #1)
> Just to be sure: they are displayed correctly, but in the wrong order. And this
> happens in Browse Music Folder only?

The answer is yes to both your questions.

The characters (ÅÄÖåäö) all display fine as well as files and folders containing the characters, but the folders are not sorted correctly (I assume it is the same for files, but I do not know for sure since all my music files are prefixed with  numbers).  

A switch between languages as per Bug# 10114 fixed the sorting in the other SC and Controller browsing pages, but not when browsing the Music Folder.
Comment 3 James Richardson 2009-01-21 13:27:00 UTC
Michael: would this be yours to fix? if not, reassign
Comment 4 Michael Herger 2009-01-22 02:34:47 UTC
vagskal - do you have perl installed on your machine and can run SC from the source? If so - could you please try the following change?

Index: /Users/mh/Documents/workspace/7.3/server/Slim/Music/Info.pm
===================================================================
--- /Users/mh/Documents/workspace/7.3/server/Slim/Music/Info.pm	(revision 24732)
+++ /Users/mh/Documents/workspace/7.3/server/Slim/Music/Info.pm	(working copy)
@@ -900,6 +900,9 @@
 }
 
 sub sortFilename {
+	
+	use locale;
+	
 	# build the sort index
 	# File sorting should look like ls -l, Windows Explorer, or Finder -
 	# really, we shouldn't be doing any of this, but we'll ignore


If not, I can provide you with a custom build of squeezecenter.exe
Comment 5 Michael Herger 2009-01-22 04:19:28 UTC
Created attachment 4687 [details]
Patched executable to support localized sort in Browse Music Folder

Please give this a try:

- shut down SC
- locate squeezecenter.exe on your disk and rename it (backup)
- put the attached version in its place
- restart SC

does this change the sort order?
Comment 6 vagskal 2009-01-22 06:41:58 UTC
(In reply to comment #5)
> Created an attachment (id=4687) [details]
> Patched executable to support localized sort in Browse Music Folder
> 
> Please give this a try:
> 
> - shut down SC
> - locate squeezecenter.exe on your disk and rename it (backup)
> - put the attached version in its place
> - restart SC
> 
> does this change the sort order?

Thanks for the executable (I am afraid that the perl thing suggested went a bit above my head).

I did as you suggested, but the sort order did not change.

Comment 7 Michael Herger 2009-01-23 08:45:56 UTC
Ok, my previous attempt obviously failed, because it didn't address the real issue.
Comment 8 Michael Herger 2009-01-23 08:50:34 UTC
Created attachment 4691 [details]
new build removing our file name normalization

We were using kind of normalization when sorting, which meant ö -> o etc. This version doesn't do this any more, but relies on the system's locale instead. I tested this on a Swedish Windows and it's looking promising:

a
Exempelmusik
o
p
Plalylists
ä
ö
Comment 9 vagskal 2009-01-24 02:14:19 UTC
(In reply to comment #8)
> Created an attachment (id=4691) [details]
> new build removing our file name normalization
> 
> We were using kind of normalization when sorting, which meant ö -> o etc. This
> version doesn't do this any more, but relies on the system's locale instead. I
> tested this on a Swedish Windows and it's looking promising:
> 
> a
> Exempelmusik
> o
> p
> Plalylists
> ä
> ö

This one worked for me. Thanks!

When will this fix be included in a SC 7.3.3 nightly?
Comment 10 Michael Herger 2009-01-24 04:55:01 UTC
change 24748 - use system's locale to do the sorting instead of "normalizing" filenames our way.

This change will be in tomorrow's (25th) build.
Comment 11 vagskal 2009-01-24 08:35:22 UTC
(In reply to comment #10)
> change 24748 - use system's locale to do the sorting instead of "normalizing"
> filenames our way.
> 
> This change will be in tomorrow's (25th) build.

Thanks!

Comment 12 Anoop Mehta 2009-04-23 13:20:33 UTC
marking as verified. 

Please re open if problem re occurs.
Comment 13 James Richardson 2009-06-17 09:36:22 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 14 vagskal 2010-04-07 02:21:23 UTC
After upgrading to 7.5.1 I tried browsing the music folder and the sort order is wrong again; same issue as before.

(BUT for the first time in a very long time the sort order in the artist list is correct after a version update, without having to switch language back and forth. Well done!)
Comment 15 Michael Herger 2010-04-07 22:47:40 UTC
what interface are you using? Do you see the same on all interfaces (Web, classic, squeezeplay)?
Comment 16 vagskal 2010-04-08 00:06:28 UTC
It is the same in the web UI and on the controller (and in iPeng). I have not checked on the SB3.
Comment 17 vagskal 2010-04-08 00:08:01 UTC
Just checked: It is the same also on the SB3.
Comment 18 Alan Young 2010-12-10 02:38:40 UTC
The original problem was fixed in 7.3.3. It appears that the problem has reoccurred and that is covered by bug 14906. Closing this bug.