Pregunta

I was wondering what is the internals of Phalcon using with regards to UTF8?

For instance if I use something like this

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

However

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

strlen is not UTF8 compatible so one has to use the mb_strlen to be safe.

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

Thanks!

¿Fue útil?

Solución

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

Phalcon, only uses strlen when working with directory names (not sure if anyone is using directories with multi-byte characters).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top