[pmwiki-users] problem with page title and file name, under utf-8

Petko Yotov 5ko at 5ko.fr
Tue Apr 14 18:28:17 CDT 2009

On Tuesday 14 April 2009 23:00:05 nikos wrote:
> I have a problem with page titles,
> and possibly with file names,
> under utf-8.
> While the content text looks ok,
> the non-English titles are not readable.

The problem with the titles in the skin is using the function strtolower() in 
abitmodern.php. Strtolower() is not compatible with multibyte UTF-8.

You should either remove it, or, if you require lowercase titles, replace it 
with PmWiki's $StrFoldFunction (version 2.2.0 stable or newer) in the file 

  # remove
  $GLOBALS['title'] = FmtPageName('$WikiTitle', $pagename);
  $GLOBALS['currentpage'] = FmtPageName('$Namespaced', $pagename);

  # or, use $StrFoldFunction :
  global $StrFoldFunction;
  $GLOBALS['currentpage'] = 
     $StrFoldFunction(FmtPageName('$Namespaced', $pagename));
  $GLOBALS['title'] = $StrFoldFunction(FmtPageName('$WikiTitle', $pagename));

> In the ftp manager (Konqueror),
> as well as in the web based file manager,
> the non-English file names,
> are  unreadable.

This happens if the filesystem of the hosting server is mounted with a 
different encoding, like Latin1 instead of UTF-8. While this is certainly 
annoying, PmWiki should be able to search, list and find its own pages. 

In Konqueror, there is the command in the menus:
  Tools > Select Remote Charset > Unicode (utf8)

Then reload the folder (F5).

There is also a recommended order when you include UTF-8 in config.php:
1. First (optional), some PageStore class like PerPageDirectories, SQLite, 
CompressedPageStore. You don't have to use one of those, but if you do, it is 
better to include it before any other recipes.

2. Second, before you include any other recipes :
  include_once("$FarmD/scripts/xlpage-utf-8.php"); # -OR/AND-
  XLPage("PmWikiGr.XLPage"); # if you have such line

3. Any other recipes, AuthUser, PmForm, etc.

Hope that helps.


More information about the pmwiki-users mailing list