We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Non-English characters appear corrupted in Regex

Hi guys , I have a problem with preg_replace

$text = preg_replace('/(?<!\S)#([0-9\p{L}]+)/', '<a href="/hashtag/$1" class="hashtagHref">#$1</a>', $text);

For non-English characters, it returns: ���

But the same code works fine for non-English characters in this link https://regex101.com/r/Pquem3/1 I have the tag <meta charset = "UTF-8">'on my page just in case. Thanks in advance

Didn't see this. Will try to use