Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2022-02-15 17:53:55

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,094
Website Mastodon

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

#14 2022-02-15 19:07:24

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

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

#15 2022-02-16 04:01:43

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

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

#16 2022-02-16 09:47:33

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

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

#17 2022-02-16 09:54:58

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

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

#18 2022-02-16 10:27:07

etc
Developer
Registered: 2010-11-11
Posts: 5,236
Website GitHub

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

#19 2022-02-16 10:42:18

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

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

#20 2022-02-16 11:01:47

etc
Developer
Registered: 2010-11-11
Posts: 5,236
Website GitHub

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

#21 2022-02-16 22:36:28

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,094
Website Mastodon

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_ci

Viewing db ‘oskg’:
Table: textpattern; Collation: utf8_swedish_ci

Viewing table ‘textpattern’ – Structure:
Field: ‘Title’; Collation: utf8_swedish_ci

does this post offer any clues:


…. texted postive

Offline

Board footer

Powered by FluxBB