Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Vanilla 2.3 fully supports PHP 7. Get it now!
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Modification to support UTF-8 replacement

This discussion is related to the Civil Tongue addon.
I wanted support for UTF-8 so in file [class.civiltongue.plugin.php]
I replaced inside
private function GetPatterns() {
the line

$Patterns[] = '/\b' . preg_quote(ltrim(rtrim($Word))) . '\b/is';

with

$Patterns[] = '/' . preg_quote(ltrim(rtrim($Word))) . '/uis';

Now it replaces UTF-8 words . I don't know why the "\b" existed.

A problem with my modification is that although it ignores case [ΤΕΣΤ=τεστ=ΤεΣτ] it doesn't consider [τεστ and τέστ] the same.

Any ideas on how to fix that?
Sign In or Register to comment.