[pmwiki-users] Search for terms with ss and ß
Petko Yotov
5ko at 5ko.fr
Fri Feb 3 07:22:00 PST 2023
Yes, I have this already. Here is the new recipe:
https://www.pmwiki.org/wiki/Cookbook/UnaccentUTF8
Not sure if it will be enough for you as it also folds to lowercase. But
you can copy this function and adapt it. Maybe simply remove "::
Lower();" from the argument, or review the documentation for the
Intl/Transliterator class at php.net.
Petko
On 03/02/2023 15:29, Hans Bracker wrote:
>> utf8fold() uses the $StringFolding array which defines "ß"
>> ("\xc3\x9f") as "ss".
>
>> Normally you should use the global $StrFoldFunction(terms) to fold
>> your search terms - this ensures you use the same function as the one
>> that is used when storing the page index data.
>
>> I recently wrote a function what replaces accented letters with plain
>> ones, so you can search for "voilà" or "voila" and it will find both
>> (also in Cyrillic).
>
> Ah , I understand, thank you! Looking forward to see your function!
...
> I'll need something rather than the $ISO88591MakePageNamePatterns
> array, converted to UTF-8, with entries like
> '/è/' => 'e', '/é/' => 'e', '/ê/' => 'e', '/ë/' => 'e',
> (see https://www.pmwiki.org/wiki/Cookbook/ISO8859MakePageNamePatterns
> for that array).
> So I might just do that, or perhaps you got that already?
More information about the pmwiki-users
mailing list