简体   繁体   中英

Is Phalcon UTF8 compliant?

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!

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM