Bug 20269 - Allow selecting default collate rule
Summary: Allow selecting default collate rule
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 21923 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-22 13:09 UTC by paxed
Modified: 2025-12-03 12:58 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2018-02-22 13:09:54 UTC
For some languages, the default collate rule set in kohastructure.sql, utf8_unicode_ci, doesn't work correctly.

For example, Finnish alphabet expects the alphabet to sort abc...xyzåäö, but the unicode_ci rule doesn't handle the åäö right. Instead, we need to use the swedish_ci rule.

It would be nice to be able to define the default collate rule during install.

Problem can be seen for example when you go catalogue a new record and have frameworks starting with 'ä' or 'ö', those will sort incorrectly.

On the database, you can test this with:

insert into biblio_framework (frameworkcode, frameworktext) values ('TEST', 'Äänikirja');

-- Note where the 'Äänikirja' is located
select * from biblio_framework order by frameworktext collate utf8_unicode_ci;

-- And then the correct order, with 'Äänikirja' last:
select * from biblio_framework order by frameworktext collate utf8_swedish_ci;
Comment 1 Katrin Fischer 2023-10-07 23:36:28 UTC
*** Bug 21923 has been marked as a duplicate of this bug. ***
Comment 2 Magnus Enger 2025-12-03 12:58:04 UTC
This is an issue for Norwegian and Swedish libraries too. The places we have had the most reactions to it is in the sorting of patrons and libraries by name, I think.