Re:PHP Doesn't Suck Anymore
by njuw on Saturday May 04, 2024 @07:40AM
(#40256891)
They're UTF-16, and substr(), length, etc, work at the code unit level. Hence, the above isn't actually valid for all strings - any characters that are represented by codepoints between U+10000 and U+10FFFF require 2 code units [1]. For example U+10429 Deseret Small Letter Long E [2]
Re:PHP Doesn't Suck Anymore
by gbuk2013 on Saturday May 04, 2024 @08:08AM
(#40257045)
TIL but it just proves my point all the more that it's the wrong level of abstraction for PHP considering what it is used for and who the target users are. :) I shouldn’t need to care about this in 2024 when building web pages.
[2] https://codepoints.net/U+10429