Good $daypart everybody,

I would like to open discussion on an RFC to deprecate and later remove the functions utf8_encode() and utf8_decode()

https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode

This is not a straight-forward decision, because these functions are not actually broken, and do have a narrow set of legitimate use cases - they convert between ISO 8859-1 (the single-byte encoding also known as "Latin 1") and UTF-8.

However, their naming and implementation leads to them so frequently being misused, that I believe their inclusion in the language does more harm than good. By deprecating and removing them, we can encourage users to specify their source and target encodings explicitly using one of several more flexible functions.

In previous discussions, alternatives have been proposed to improve these functions, but I am not convinced this is in the long-term interest of the language (see "Rejected Features" section in the RFC).

Note: one of the alternatives, UConverter::transcode, is currently undocumented; I have written a documentation patch to address this and other issues, regardless of the RFC's result: https://github.com/php/doc-en/pull/1418

Your feedback on the RFC, and the proposal itself, are welcome.

Regards,

--
Rowan Tommins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to