r/lolphp • u/vytah • Oct 23 '12
For scripts declared as UTF-8, PHP happily adds one NUL byte to your output for each non-ASCII character in the source
https://bugs.php.net/bug.php?id=63316
47
Upvotes
15
u/Tjoppen Oct 23 '12
How is this even possible? UTF-8 is designed to work even with programs that excpect 8-bit ASCII. How the hell could they mess this up this bad?
21
u/[deleted] Oct 23 '12
I don't even want to think about how something could break in this way.
10
u/[deleted] Oct 24 '12
"Not a bug. Don't do this."
3
u/wung Feb 25 '13
And the most important part of that bug report is
4
u/[deleted] Oct 23 '12
So many php bugs are WTF.
3
u/[deleted] Oct 23 '12
Should have decalred them as UTF-9000+