[pmwiki-users] problem with utf-8 chars and TimeFmt

Patrick R. Michaud pmichaud at pobox.com
Wed Mar 1 12:00:32 CST 2006


On Wed, Mar 01, 2006 at 01:31:46PM +0100, Sebastian Siedentopf wrote:
> Our wiki works fine with utf-8 encoding enabled (german language, the  
> locale environment is set to 'de_DE at euro') so far. The TimeFmt on the  
> XLPage is set to output the name of the month with %B. But every date  
> that is formated by the TimeFmt (RecentChanges, page history etc.)  
> has an incorrectly encoded month name.
> 
> Any idea what we can do about it?

I'm guessing your system locale libraries are generating date and 
time strings (via 'strftime') using ISO-8859-1 instead of UTF-8.

If you can find a locale setting that says to generate utf-8, then 
that might work.  You might try 'de_DE at euro.UTF-8' or some combination 
like that.

If that doesn't work, you might try using utf8_encode around the
date/time strings that PmWiki generates.  Try the following in
local/config.php:

    $FmtPV['$LastModified'] =
      'utf8_encode(strftime($GLOBALS["TimeFmt"], $page["time"]))';
    $CurrentTime = utf8_encode(strftime($TimeFmt,$Now));

(There might still be a few date conversions that we need to
update, such as history, but these should at least catch the 
LastModified and RecentChanges dates to see if this approach
has any hope of working.)

Pm




More information about the pmwiki-users mailing list