[ticket/13297] Add unicode modifier to url/email regular expression patterns

Besides, some functions calls getting replaced with their utf8 forms to allow
extensions introducing international domain names and email addresses.

<a href="https://tracker.phpbb.com/browse/PHPBB3-13297">PHPBB3-13297</a>.
You cannot mix string offset access like `$str[$x]` with functions that operate on UTF-8 codepoints like `utf8_strlen()`. And since it's the last character of the string it would be better rewritting as a `substr()` call with a negative offset anyway, assuming that `utf8_substr()` supports them. We can even throw in PHP 5.3's short ternary syntax for more concise code.
```php
$last_char = substr($relative_url ?: $url, -1);
$last_char = utf8_substr($relative_url ?: $url, -1);
```