Moving utf8_encode() and utf8_decode() to ext/standard (was: [RFC][DISCUSSION] Remove utf8_decode() and utf8_encode())
| From: | Andrea Faulds | Date: | Thu, 13 Oct 2016 22:42:05 +0000 |
| Subject: | Moving utf8_encode() and utf8_decode() to ext/standard (was: [RFC][DISCUSSION] Remove utf8_decode() and utf8_encode()) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96359@lists.php.net to get a copy of this message | ||
Hi,
This is a follow-up to what I wrote in the utf8_encode()/utf8_decode() discussion earlier:
Andrea Faulds wrote:
I would propose something else: remove them from the XML extension, and move them somewhere more fitting, like ext/intl, ext/mbstring or maybe ext/standard. These are generic functions which work on any text, not just XML, and their inclusion is mutually superfluous with respect to XML: if you're decoding XML, you don't necessarily need to convert text to/from UTF-8, and if you're converting text to/from UTF-8, you don't necessarily need to deal with XML. Plus, given the names alone, you'd have no idea they're part of the XML extension.Since these functions are generic string functions that have no dependency on libxml, I've written a patch to move them to ext/standard, and simplified their code a little bit. Pull request here: https://github.com/php/php-src/pull/2160 This doesn't currently do any function renaming or aliasing, but I should probably do that next. Plus, the manual still needs updating. Are there any objections to this move? There'd be no backwards-compatibility break. Thanks! -- Andrea Faulds https://ajf.me/