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

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Unfortunately, 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.

Vidarls’s picture

Title: Views is not sorting national characters (æøå) correctly » Views is not sorting national characters (æøå) correctly Solved
Status: Closed (won't fix) » Fixed

Thank 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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Marko B’s picture

Version: 5.x-1.6 » 6.x-3.0

Some 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-...

ressa’s picture

Issue summary: View changes

I 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:

ALTER DATABASE COLLATE utf8_danish_ci;
ALTER TABLE node_field_data CONVERT TO CHARACTER SET utf8 COLLATE utf8_danish_ci;
s@ilor’s picture

@ 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.