rfc:remove_utf8_decode_and_utf8_encode
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:remove_utf8_decode_and_utf8_encode [2022/03/04 23:24] – imsop | rfc:remove_utf8_decode_and_utf8_encode [2022/06/21 09:42] (current) – The RFC has been implemented cmb | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Deprecate and Remove utf8_encode and utf8_decode ====== | ====== PHP RFC: Deprecate and Remove utf8_encode and utf8_decode ====== | ||
- | * Version: 1.1 | + | * Version: 1.2 |
- | * Date: 2022-03-04 | + | * Date: 2022-04-04 |
* Author: Rowan Tommins < | * Author: Rowan Tommins < | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
Line 18: | Line 18: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | * In PHP 8.2, all uses of utf8_encode and utf8_decode will raise an E_DEPRECATED diagnostic. Proposed wording: | + | * In PHP 8.2, all uses of utf8_encode and utf8_decode will raise a standard |
* In PHP 9.0, the utf8_encode and utf8_decode functions will be removed from PHP. | * In PHP 9.0, the utf8_encode and utf8_decode functions will be removed from PHP. | ||
* Documentation and deprecation messages will encourage users to check that their usage is correct, and recommend '' | * Documentation and deprecation messages will encourage users to check that their usage is correct, and recommend '' | ||
Line 147: | Line 147: | ||
These vary slightly in the options available, particularly around invalid and unmappable UTF-8 input. The ' | These vary slightly in the options available, particularly around invalid and unmappable UTF-8 input. The ' | ||
- | Of these three extensions, ext/ | + | Of these three extensions, ext/ |
+ | |||
+ | By contrast, ext/iconv is required by only 6 (plus 4 via '' | ||
+ | |||
+ | The possibility | ||
An exact replacement is also straight-forward to implement in pure PHP, as long as performance is not critical. Examples are available in [[https:// | An exact replacement is also straight-forward to implement in pure PHP, as long as performance is not critical. Examples are available in [[https:// | ||
Line 189: | Line 193: | ||
The use of these functions internally within the ext/xml extension has not been examined, and will not be changed. | The use of these functions internally within the ext/xml extension has not been examined, and will not be changed. | ||
- | |||
- | ===== Open Issues ===== | ||
- | |||
- | * Exact wording of deprecation notice. | ||
- | * What alternatives should the manual actively promote? | ||
- | |||
- | ===== Proposed Voting Choices ===== | ||
- | |||
- | Should utf8_encode and utf8_decode be deprecated in 8.2 and removed in 9.0? (Yes / No) | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
- | * [[https:// | + | * [[https:// |
===== References ===== | ===== References ===== | ||
Line 232: | Line 227: | ||
However, this would require either implementing a significant amount of extra code, or wrapping one of the existing functions, all of which are in optional extensions. It would also require several versions before the benefit could be realised: first, add the parameter; in a later version, raise a deprecation if the new parameter is not passed; finally, make the parameter mandatory. Users would then still need to check and update every use of the functions, which would be a similar effort to switching to a new function. | However, this would require either implementing a significant amount of extra code, or wrapping one of the existing functions, all of which are in optional extensions. It would also require several versions before the benefit could be realised: first, add the parameter; in a later version, raise a deprecation if the new parameter is not passed; finally, make the parameter mandatory. Users would then still need to check and update every use of the functions, which would be a similar effort to switching to a new function. | ||
- | ==== Changelog ==== | + | ===== Vote ===== |
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | Voting started 2022-04-05 18:40 UTC, and will run for two weeks, closing 2022-04-19 18:40 UTC | ||
+ | |||
+ | ===== Changelog | ||
* v1.0 (2022-02-20) Initial version sent for discussion | * v1.0 (2022-02-20) Initial version sent for discussion | ||
* v1.1 (2022-03-04) Made a stronger recommendation of mb_convert_encoding as a replacement (see " | * v1.1 (2022-03-04) Made a stronger recommendation of mb_convert_encoding as a replacement (see " | ||
+ | * v1.2 (2022-04-04) Dropped proposed custom wording for deprecation message. The nuances can be better expressed in the manual. |
rfc/remove_utf8_decode_and_utf8_encode.1646436289.txt.gz · Last modified: 2022/03/04 23:24 by imsop