Opened 15 years ago
Last modified 8 months ago
#11740 new defect (bug)
Sorting tags and towns does not work well for utf-8
Reported by: | pavelevap | Owned by: | nbachiyski |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | I18N | Keywords: | 2nd-opinion needs-patch |
Focuses: | Cc: |
Description
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)
#2
@
15 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 continents-cities-cs_CZ.mo file and not database?
Ad 2) For tags it was helpfull, thank you...
#3
@
15 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
@
15 years ago
see also this for reference:
http://fr2.php.net/manual/en/function.setlocale.php
as there are quite a few strings attached.
#5
@
15 years ago
Yes, I tried your codeline, but "Řím" is still the first...
I am using latest trunk (3.0-alpha).
#6
@
15 years ago
- Keywords 2nd-opinion added; reporter-feedback removed
might be related:
http://fr2.php.net/manual/en/function.setlocale.php
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
@
15 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
@
15 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.
This ought normally be handled at the database level, and it would depend on the DB_COLLATE setting that you've selected:
http://dev.mysql.com/doc/refman/5.1/en/charset-unicode-sets.html
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.