Is Phalcon UTF8 compliant?

I was wondering what are the internals of Phalcon using UTF8?

For example, if I use something like this

echo strlen('hello'); // output 5 

but

 echo strlen('汉字/漢字'); // will output something like 10 

strlen is not compatible with UTF8, so mb_strlen must be used for security.

Does Phalcon use (internally) mb_ * related functions? If not, how can we guarantee that everything is internally handled using UTF8 to ensure compatibility with all languages?

Thanks!

+4
source share
1 answer

PHP is currently binary safe, which means you can work with multibyte strings (like utf8 or other encodings), latin1 or ascii in a transparent way.

Phalcon uses strlen only when working with directory names (not sure if anyone uses directories with multibyte characters).

+4
source

Source: https://habr.com/ru/post/1435521/


All Articles