Even your supplied link states they’re not supported at a “low level”, but states nothing about “native”.
Consider the intended purpose of the language and then consider whether the abstraction offered is appropriate. IMO in the case of PHP and UTF-8 it is not.
In my specific case it made my job harder than I would like on 2 projects I used PHP for, which is why I am complaining.
TLDR: in 2024 with PHP8 you still need mbstring extension and also you should be careful around UTF-8 if you do any text processing. In almost all other modern programming languages it's just works.
The whole concept of having special Unicode-aware strlen or substr is nonsense.
> '蛋糕'.substr(0,1)
'蛋'
> '蛋糕'.length
2
> Buffer.byteLength('蛋糕')
6
You do have to be careful when working with binary data (e.g. streams) but this is expected. > '𐐩'.substr(0, 1)
'\ud801'
> '𐐩'.length
2
[1] https://en.wikipedia.org/wiki/UTF-16#DescriptionIt just so happens that your example consists of two UTF-16 codepoints.
(Node.js' Buffer uses UTF-8 by default).