01210: pagelist collation

Summary: pagelist collation
Created: 2010-06-28 18:32
Status: Closed
Category: Feature
From: CarlosAB
Assigned:
Priority: 1
Version: latest
OS: freebsd/apache/php 5.2

Description: I don't know if/how collation is provided by pagelist, but since the aim of pmwiki AFAIK is to be a multilanguage wiki that uses utf-8 to achieve it, I think I have found something interesting AND simple for collation.

Take a look a the end in:

http://www.mediawiki.org/wiki/Bugzilla/collation_by_locale

I believe pagelist collation is probably "LC_COLLATE=C"...

Please comment my non-sense.

CarlosAB June 28, 2010, at 06:32 PM

Hello. Currently PmWiki uses the strcasecmp() function which is very fast but doesn't work well with UTF-8 strings and I'm not sure it respects LC_COLLATE for single-byte strings. I have used this snippet to sort a pagelist in a French language wiki. For a wiki in UTF-8, you can change the setlocale line to setlocale(LC_COLLATE, 'fr_FR.utf8'); instead of just fr_FR. --Petko November 09, 2010, at 07:01 AM

Thanks Petko, that is exactly what I was looking for and also finally learned about CustomPagelistSortOrder.I'm closing this entry. CarlosAB February 03, 2011, at 02:50 PM

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_COOKIE] => imstime=1777502295; PHPSESSID=bg7k5h4rppphc5tnup6ok182v0
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=PITS%2f01210
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=PITS%2f01210
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/PITS/01210
            [REDIRECT_SCRIPT_URL] => /wiki/PITS/01210
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afKIaxtEZa4QbKtQx_no8gAAAQU
            [REDIRECT_URL] => /wiki/PITS/01210
            [REMOTE_ADDR] => 216.73.216.31
            [REMOTE_PORT] => 38684
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/PITS/01210
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/PITS/01210
            [SCRIPT_URL] => /wiki/PITS/01210
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afKIaxtEZa4QbKtQx_no8gAAAQU
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777502316.0089
            [REQUEST_TIME] => 1777502316
            [argv] => Array
                (
                    [0] => n=PITS%2f01210
                )

            [argc] => 1
        )

)