Hacker News new | ask | show | jobs
by phplovesong 9 days ago
Still no builtin unicode support? What the hell is this? A web language that does not default to unicode, thats pretty weak for a language in 2026
2 comments

The php convention is that strings are bytes, but we store utf8 in them. Convert or validate at ingestion, transform using the mb_* family of functions, and be happy.
I have heard this exact answer for decades. The mb_slop_uppercase() is not, and should not be acceptable for any modern language.
It's a big world out there, it's not like you don't have a choice. I quite like the model.

Perl was famous for excellent native unicode support in its native string type, but the result was that you had to keep track of whether your variable was native unicode or octets, and many CPAN modules would try to transparently support both, in buggy ways. A richer system is not always an advantage.

I mean look at python, they did the correct decision and made strings unicode. Today python is more popular then ever. Even go (much more low level) have unicode strings, even if you can in theory have garbage data.

PHP just sits and clones useless ad-hoc features year after year. Its like the pinnacle of yolo development.

The idea of UTF-16 strings in PHP 6 were a mistake. UTF-8 works in PHP just fine. New languages (e.g. Rust, Go, Swift) stick to UTF-8. UTF-16 is legacy that would be nice to get rid of where it's used (Java, C#, JS, WinAPI), but that is impossible because of backwards compatibility.
Hindsight is 20/20, it's easy now to say that if Unicode had been utf8 from the start, no 16-bit encoding would have been needed anywhere. But someone had to think of it first, and in the real world, 16-bit came first and became quite entrenched.
UTF-8 is not ideal for Chinese, Japanese and Korean (CJK) where every character would require unnecessarily complex encoding.
PHP6 was such a huge lol overall. The core devs seem so far gone its crazy. I see the odd php apologist every now and then, but luckily PHP use has been on the decline for the last decade and a half.
Obviously PHP 6 was a huge “lol”, they abandoned the version number completely. I didn’t start working with PHP until v7 so I missed all of that, but what does any of that have to do with v8.6? Seems like you just want to resurrect ancient buried arguments nobody is worried about anymore.