Open avriltank opened 2 years ago
You are right, in general, there are some incompatibilities.
We have tried to make PHP Unicode safe and to take advantage of the .NET native String
(UTF-16) type.
There are some known exceptions described at https://docs.peachpie.io/php/unicode/
Wherever you need to treat the value as 8-bit string, you can cast it using (binary)
operator, e.g.:
strlen( (binary)"张三" );
Currently, this is a known behavior, and basically, we are still evaluating what would be the right approach.
For example: strlen("张三") //should be 6,php code Encoding.Default.GetByteCount("张三")
if we edit the code of peachpie,there are many functions should be edited,such as "strpos","strrpos","fread"....