Sorting reports correctly for Norwegian

From Koha Wiki
Jump to navigation Jump to search

Sometimes you create a report and sort on a column like borrowers.surname, but the sorting is off: You get Ø sorted along with O etc. This is because the collation of the column in the database is wrong.

By default it is:

`surname` mediumtext COLLATE utf8_unicode_ci NOT NULL,

To fix the collatoin, run this:

ALTER TABLE borrowers MODIFY surname mediumtext CHARACTER SET utf8 COLLATE utf8_danish_ci NOT NULL;

The definition of the column should now be:

`surname` mediumtext CHARACTER SET utf8 COLLATE utf8_danish_ci NOT NULL,

And the sorting on Norwegian surnames should now work as you expected.