Re: [RFC][DISCUSSION] Remove utf8_decode() and utf8_encode()
| From: | Stanislav Malyshev | Date: | Mon, 15 Aug 2016 19:47:14 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Remove utf8_decode() and utf8_encode() | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95206@lists.php.net to get a copy of this message | ||
Hi!
>> 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".
I still think if one does it without even reading one-line description
in the manual, they deserve what they get.
I know people will click on any binary that says "please click on me,
honestly I'm not a trojan" but programmers are supposed to know a little
better? Like not running functions they don't know what they do, even
without reading one-line description?
> 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.
Deprecating - maybe, since there are better alternatives to it anyway
(like iconv or recode), but I don't see much point in removing unless we
have no usage at all.
--
Stas Malyshev
smalyshev@gmail.com