[TYPO3-english] vge_tagcloud and proper handling of UTF-8 tags

François Suter fsu-lists at cobweb.ch
Wed Apr 13 08:34:49 CEST 2011


> There is however an easy solution: use the modifier 'u'. [1] It can
> reduce performance, but at least you have a UTF-8 aware regular expression.
>
> [1] http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php

And now tested with vge_tagcloud and it works fine.

Alex, however you won't be able to make this change in TypoScript, 
because of the way it's interpreted for now. You'll need to hack the 
code of the "pi1" plugin yourself. Edit class.tx_vgetagcloud_pi1.php, go 
to line 408:

$rawKeywords = preg_split('/' . addcslashes($this->conf['splitWords'], 
"'/") . '/', strip_tags($row[$aField]));

and change it too:

$rawKeywords = preg_split('/' . addcslashes($this->conf['splitWords'], 
"'/") . '/u', strip_tags($row[$aField]));

The only difference is the "u" added after the last slash.

The usage of the "splitWords" property needs to be changed to include 
the regexp delimiters so that people can enter modifiers too. I hadn't 
thought about that originally. I'll use your bug report to cover this issue.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-english mailing list