On 15/08/2016 06:26, Stanislav Malyshev wrote:
Hi!
Hi all,
utf8_decode() and utf8_encode() are not needed and causing
problems than solving.
Why you think they are not needed?
I'm guessing this came about from their mention on another thread. To
quote myself:
utf8_decode()/utf8_encode are, at best, extremely misleading names.
Many uses of them in my experience go something like this: "I have an
encoding problem, it's something to do with UTF-8, I'll try
utf8_encode; hm, that didn't work, I'll try utf8_decode instead".
They are certainly used in many, many places; but I would wager that
almost all of those uses are broken because they make no effort to
confirm that 8859-1 is the right source / target encoding. I think
deprecating (but not removing) them might be sensible, because it would
discourage this broken logic.
They are also trivially polyfillable; and again, anyone doing so will
probably realise they misunderstood them and shouldn't be using them in
the first place.
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php