note 89691 deleted from function.str-split by crell
| From: | crell@php.net | Date: | Wed, 29 Jun 2022 18:34:00 +0000 |
| Subject: | note 89691 deleted from function.str-split by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218693@lists.php.net to get a copy of this message | ||
Note Submitter: mattias at lsahlin dot se
----
For those it may concern:
We encountered trubble when trying to str_split a UTF-8 encoded string, containing such Swedish
letters as å, å and ö.
It seems that this function splits according to byte-length and not character length. So if the
letter "Ã
" takes 2 bytes, then str_split() will only return the first bite of the
character "Ã
".
We ain't 100% sure that this is the case but this was anyhow the result we got. So we used the
multi-byte functions instead.