Make WordPress Core

Opened 14 years ago

Last modified 6 weeks ago

#11740 new defect (bug)

Sorting tags and towns does not work well for utf-8

Reported by: pavelevap's profile pavelevap Owned by: nbachiyski's profile nbachiyski
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 2.9
Component: I18N Keywords: 2nd-opinion needs-patch
Focuses: Cc:


There are problems with sorting special Czech characters:

1) Options - General - Timezone selection.

Evropa (Europe)
First item should be Amsterdam, but instead of it there is "Řím" (Rome in Czech). And this is not right, character Ř should be between R and S.

2) Editing posts - Select from most used tags.

You can create tags "Rome", "Amsterdam" and "Řím".
Tags are also sorted in a bad way, first is "Řím".
It is very problematic for Czech users when there are many tags, because it does not help them...

Change History (14)

#1 @Denis-de-Bernardy
14 years ago

  • Keywords reporter-feedback added

This ought normally be handled at the database level, and it would depend on the DB_COLLATE setting that you've selected:

use utf8_czech_ci instead of general_general_ci

please give it a shot (you'll need to do plenty of alter table statements) and close accordingly if it's invalid indeed.

#2 @pavelevap
14 years ago

So when I first time install WordPress how can I set utf8_czech_ci for my install (as a non-experineced user)? Can I add it somehow to Czech version of WordPress (I am maintainer of Czech version)?

I tried to add

define('DB_COLLATE', 'utf8_czech_ci');

to my wp-config.php and:

Ad 1) No change. I think towns are stored in file and not database?

Ad 2) For tags it was helpfull, thank you...

#3 @Denis-de-Bernardy
14 years ago

  • Milestone changed from 2.9.2 to 3.0
  • Version set to 2.9

You're correct for the cities. Please try to add this in your wp-config.php file:

setlocale(LC_COLLATE, 'cs_CZ.utf8');

#4 @Denis-de-Bernardy
14 years ago

see also this for reference:

as there are quite a few strings attached.

#5 @pavelevap
14 years ago

Yes, I tried your codeline, but "Řím" is still the first...

I am using latest trunk (3.0-alpha).

#6 @Denis-de-Bernardy
14 years ago

  • Keywords 2nd-opinion added; reporter-feedback removed

might be related:

The locale information is maintained per process, not per thread. If you are running PHP on a multithreaded server API like IIS or Apache on Windows, you may experience sudden changes in locale settings while a script is running, though the script itself never called setlocale(). This happens due to other scripts running in different threads of the same process at the same time, changing the process-wide locale using setlocale().

I've doubts that this part can be properly fixed unless you've a dedi or a VPS.

#7 @pavelevap
14 years ago

I tried it now also on my websites on Linux webhosting (WordPress 2.9.1) and it also does not work.

So what should be done for Czech version (for non-experienced users):

  • To enable sorting alphabetically in Most Used tags?
  • To enable sorting timezone cities also alphabetically?

#8 @Denis-de-Bernardy
14 years ago

For stuff that is sorted by the database, there ought to be better doc in the codex (at least initially). It could point to the above url -- it's a bit technical, but understandable.

For stuff sorted by php, I'm absolutely certain that there needs to be some kind of server-level or process-level parameter. setlocale() was my best bet. 2nd opinion needed.

#9 @dd32
14 years ago

  • Milestone changed from 3.0 to Future Release

Moving to Future release due to no recent traction or patches.

#11 @SergeyBiryukov
12 years ago

Closed #15652 as a duplicate.

#12 @SergeyBiryukov
10 years ago

#29940 was marked as a duplicate.

#13 @chriscct7
8 years ago

  • Keywords needs-patch added

#14 @swissspidy
6 weeks ago

  • Milestone set to Awaiting Review
Note: See TracTickets for help on using tickets.