Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Swedish collation fail despite utf8_swedish_ci
helsinkifrostbites wrote #332718:
I’m pulling my hair out with this one. I’ve got a Swedish site oskg.nu with a list of artists in alphabetical order. I can’t get them to sort according to correct Swedish alphabet (åäö at the end), despite having set the collation and charset to utf8_swedish_ci everywhere I could find.
Curious. When did you first start your website? Did you notice problems with sorting right away or later on? And when you first created your DB what was the collation that you used?
…. texted postive
Offline
Re: Swedish collation fail despite utf8_swedish_ci
I set the site up in november. The collation was whatever it gets per default – utf8_general_ci probably?
I built most of the site first, didn’t think about collation until I had put enough content in to notice that it was in the wrong order. Then I thought oh yes, I’ve done this before for other sites, I just need to change the collation of the ‘textpattern’ table to ‘utf8_swedish_ci’ and Bob’s your uncle. But, alas.
Offline
Re: Swedish collation fail despite utf8_swedish_ci
I am seeing this order at https://oskg.nu/konstnaerer/:
Mette Wide
Gunilla Widholm
Kattarina Yxhufvud
Gerd Zinnerström
Ola Åstrand
Kjell Åström
Tony Åström
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: Swedish collation fail despite utf8_swedish_ci
Yes, thank you Kjeld. I cobbled together a workaround (see my earlier post ) so it looks fine now, but the underlying collation problem is still unresolved.
Offline
Re: Swedish collation fail despite utf8_swedish_ci
helsinkifrostbites wrote #332762:
Yes, thank you Kjeld. I cobbled together a workaround (see my earlier post ) so it looks fine now, but the underlying collation problem is still unresolved.
Sounds frustrating, and it is sadly beyond my expertise level. I hope you can figure it out.
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: Swedish collation fail despite utf8_swedish_ci
Yep, frustrating. Please check whether collations are really set to utf8_swedish_ci
. On my localhost I’m not able to change it for an existing txp db (some ‘index too large’ error). A fresh db with utf8mb4_swedish_ci
collation seems to work fine.
Offline
Re: Swedish collation fail despite utf8_swedish_ci
Well, it certainly looks like everything’s set right in phpMyAdmin.
in Databases view:
Database: oskg; Collation: utf8_swedish_ci
Viewing db ‘oskg’:
Table: textpattern; Collation: utf8_swedish_ci
Viewing table ‘textpattern’ – Structure:
Field: ‘Title’; Collation: utf8_swedish_ci
Offline
Re: Swedish collation fail despite utf8_swedish_ci
Weird. For me, it was sufficient to alter just Body
and Title
collations (both, because they are bound by fulltext index):
ALTER TABLE textpattern MODIFY Title VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_swedish_ci,
MODIFY Body MEDIUMTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_swedish_ci;
With $txpcfg['dbcharset'] = 'utf8mb4';
in config.php
everything looks fine.
Are you able to sort by Swedish collation some test table (not necessarily txp) on your server at all?
Offline
Re: Swedish collation fail despite utf8_swedish_ci
helsinkifrostbites wrote #332765:
Well, it certainly looks like everything’s set right in phpMyAdmin.
in Databases view:
Database: oskg; Collation: utf8_swedish_ciViewing db ‘oskg’:
Table: textpattern; Collation: utf8_swedish_ciViewing table ‘textpattern’ – Structure:
Field: ‘Title’; Collation: utf8_swedish_ci
does this post offer any clues:
…. texted postive
Offline