I have a view where nodes are sorted only by node title, alphabetically.
The problem is that when the node title contains Norwegian national characters (Ææ, Øø, Åå) the sorting order breaks.
i.e: Å is the last letter in the Norwegian alphabet. Views treats the letter Å the same as A, which is the first letter in the alphabet.
This is causing quite a bit of confusion as people are looking for words starting with "Å" at the bottom of lists, not the top.
I searched the site for any previously reported cases, but I could only find this issue (http://drupal.org/node/108001) from the tagadelic project that does not seem to be solved.
I believe that this could be an issue for other national charactes as well.
Comments
Comment #1
merlinofchaos commentedUnfortunately, views sorting is just telling the database to sort via ORDER BY; probably what you need to do is adjust the collation of your tables, but this isn't something I am familiar with and I can't help you with. I recommend you hit mysql.com and search for language and collation of your tables.
Comment #2
Vidarls commentedThank you very much for that advice.
I changed the collation of the node tables title field to utf8_danish_ci, and now the alphabet is correctly ordered again.
This fixed my most pressing issue, but changing the collation of all my fields in all my tables, in all of my databases manually does not seem like a very appealing task. I need to know if there are any SQL trick to change the collation og all fields in all tables in a database automatically. Any advice would be very much appreciated.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
Marko B commentedSome update to this. Indeed this can be solved with changing of collation of tables for all views.
http://www.drupaldump.com/mysql-alter-table-collation-views-not-sorting-...
Comment #5
ressaI got here because I was having sorting problems with letters like æ, å, ø and Ð.
I found an article (in Danish) outlining how to change the collation of a table, and sorting now works as expected. These two commands fixed it:
Comment #6
s@ilor commented@ ressa
I came here for the same reasons. I, however, cannot get it to work correctly regarding A and Å. Ø is now correctly placed at end of alphabet, and Å should be after Ø. Instead, it's still confused with A. No amount of ALTER TABLE will change that. Rather frustrating.