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

Petko Yotov 5ko at 5ko.fr
Mon Oct 5 07:38:47 PDT 2020


When you type in a page [[Index.Pépé123]] (not Index:pépé), does it 
create the page Index.Pepe123 or Index.Pépé123 ?

If Index.Pepe123 is created and linked, the problem comes indeed from 
the Tagger recipe.

If it creates Index.Pépé123, there is a problem either with PmWiki, or 
with your configuration.

If you type a link [[A group not in tagger/Pépé123]], what page is 
linked, AGroupNotInTagger.Pepe123 or AGroupNotInTagger.Pépé123?

In the first case all is good, in the second you have a problem with 
your configuration-- probably incorrect encoding of the config.php file. 
As the wiki has utf-8 enabled, then the config.php needs to be in the 
same encoding, see

   https://www.pmwiki.org/wiki/PmWiki/LocalCustomizations#encoding

Petko

On 03/10/2020 21:02, ABClf wrote:
> 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