You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe there is a problem with this line:
$size = mb_strlen($data, 'UTF-8');
It returns the number of UTF-8 characters in $data. As UTF-8 is a multi-byte encoding, this number can vary from the actual length in bytes. This means the string would not fit into the reserved shared memory block.
The following fix would return the number of bytes:
$size = mb_strlen($data, '8bit');
Best regards,
gwyn
The text was updated successfully, but these errors were encountered:
Yes I wanted to say the same thing. You need the number of bytes not characters.
Also, only increase size if necessary. No need to shrink. Or put a threshold.
Hello Klaus,
I believe there is a problem with this line:
$size = mb_strlen($data, 'UTF-8');
It returns the number of UTF-8 characters in $data. As UTF-8 is a multi-byte encoding, this number can vary from the actual length in bytes. This means the string would not fit into the reserved shared memory block.
The following fix would return the number of bytes:
$size = mb_strlen($data, '8bit');
Best regards,
gwyn
The text was updated successfully, but these errors were encountered: