[pmwiki-users] get rid of special characters in page names creation (when Tagger recipe is used)

ABClf languefrancaise at gmail.com
Sat Oct 3 12:02:12 PDT 2020


Hello,

I want internal links get rid of special characters, replacing for
example : é with e, ç with c, in such a way [[Pépé]] will link to page
named Pepe, and [[Garçon]] will link to page named Garcon.

I have some lines (1) in my config devoted to that purpose and it
looks like it's working.

But I have an issue with Tagger cookbook recipe (used together with
autocreate category).
Among other things, Tagger has these lines :

$TaggerGroups['index'] = 'Index';
$AutoCreate['/^Index\\./'] = array('ctime' => $Now);

Now, when writing something like
Index: myword
I automatically get a new page named "Myword" created.
If writing something like :
Index:pépé
then I get a page named Index.Pépé, where I am expecting a special
character free name (I want : Index.Pepe).

Is there something I could do to ask Tagger to create links, using
special patterns for naming pages ?

Thank you !
Gilles.

(1) My config has these lines

# UTF-8 & francisation
# The include_once line is recommended if you start a new wiki
# and it should be placed before the XLPage line (for languages with
alphabets other than the Latin, the include_once line is required).
# -- IMPORTANT -- These lines should be placed near the beginning of
config.php, but after any $WikiDir and $WikiLibDirs setting (if you
have such setting).
include_once("scripts/xlpage-utf-8.php");
#$DefaultPageCharset = array(''=>'ISO-8859-1'); # problématique
XLPage('fr','PmWikiFr.XLPage');
XLPage('fr','PmWikiFr.XLPageCookbook'); // S'il y a des modules
 ....
 ....
 ....
# standard patterns from pmwiki.php
SDV($PageNameChars, '-[:alnum:]');
SDV($MakePageNamePatterns, array(
    "/'/" => '',    # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',         # convert everything else to space
    '/((^|[^-\\w])\\w)/' => 'cb_toupper',  # capitalize first letter of word
    '/ /' => '')); #function
# additonal character conversion patterns for ISO 8859-1 character set
SDV($ISO88591MakePageNamePatterns, array(
'/Á/' => 'A', '/Â/' => 'A', '/Ã/' => 'A', '/Ä/' => 'Ae', '/Å/' =>
'Ao', '/Æ/' => 'Ae', '/Ç/' => 'C',
'/È/' => 'E', '/É/' => 'E', '/Ê/' => 'E', '/Ë/' => 'E', '/Ì/' => 'I',
'/Í/' => 'I', '/Î/' => 'I', '/Ï/' => 'I',
'/Ð/' => 'D', '/Ñ/' => 'N', '/Ú/' => 'U', '/Ó/' => 'O', '/Ô/' => 'O',
'/Õ/' => 'O', '/Ö/' => 'Oe', '/Ø/' => 'Oe',
'/Ù/' => 'U', '/Ú/' => 'U', '/Û/' => 'U', '/Ü/' => 'Ue', '/Ý/' => 'Y',
'/Þ/' => 'Th', '/ß/' => 'ss',
'/à/' => 'a', '/á/' => 'a', '/â/' => 'a', '/ã/' => 'a', '/ä/' => 'ae',
'/å/' => 'ao', '/æ/' => 'ae', '/ç/' => 'c',
'/è/' => 'e', '/é/' => 'e', '/ê/' => 'e', '/ë/' => 'e', '/ì/' => 'i',
'/í/' => 'i', '/î/' => 'i', '/ï/' => 'i',
'/ð/' => 'd', '/ñ/' => 'n', '/ò/' => 'o', '/ó/' => 'o', '/ô/' => 'o',
'/õ/' => 'o', '/ö/' => 'oe', '/ø/' => 'oe',
'/ù/' => 'u', '/ú/' => 'u', '/û/' => 'u', '/ü/' => 'ue', '/ý/' => 'y',
'/þ/' => 'th', '/ÿ/' => 'y'
));
# join to standard patterns
$MakePageNamePatterns = array_merge($ISO88591MakePageNamePatterns,
$MakePageNamePatterns);



More information about the pmwiki-users mailing list