Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117079 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30297 invoked from network); 20 Feb 2022 17:36:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Feb 2022 17:36:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 80EAD1804B3 for ; Sun, 20 Feb 2022 10:55:34 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 20 Feb 2022 10:55:34 -0800 (PST) Received: by mail-wm1-f43.google.com with SMTP id az26-20020a05600c601a00b0037c078db59cso9860137wmb.4 for ; Sun, 20 Feb 2022 10:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:from:to :subject:content-transfer-encoding; bh=KpPZDU8aXBLzsTs3X2Ww/CGuv44oDkwNfkckffc6gik=; b=pQix8/++j7exjLK7w8JcZBb6Ag4KqPboZiBMnODrBkOLpS5FOcXM4qAJt6kDfGYGnR 2u7AzpMTIDpmtpAdSTixXGh73iYwaUyjq9vKUzmt6Yo9cc6Q4W7NxdnBHrmYBsvQHhi6 ptgBwaM/S+j3O7AMjhLl7aeMhkMtWW826C1qUdLuOumQD40V+5oACaq1vfn9BxyJ1Aq1 3zmg0xKlbOqZCG1NU4HK60/1zQlQhgbnDGLL/PwEiV2BqpiisUWYuy6bdQZcYOazHnvw kATZHJMiMIFrjcNmAwOR/IK6DSAH+oo4m41rCU0kHIPi7Vqfs+Idn80wd4UsAe5WZzMX /oaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:from:to:subject:content-transfer-encoding; bh=KpPZDU8aXBLzsTs3X2Ww/CGuv44oDkwNfkckffc6gik=; b=nWCC8EOtu3qOCUtPdnjZo/smvdEK3BzrjAg7QgfhD2qTA0fGmH7LsWjegFAOxb6Amd sF9YgEtaK7TFv8S58JWmjLZ0TQXstVzngW5na4yBfvPKKkS2QZyeUPP3TVrQd/ZP7MuW o/fAk26c5yh8TaQh2B1+k/LoWweM352949TjQyAXo2j6ABGqCq/gCgxmXhO/WNQKrIUy DGwiBFK/Dsm2DVotxhTewTfKcCdBRtJaVMtC76wUdRU3CwT79xbrSD+kk9KAQ5xWvQrv az6N/1neUms3WfPId8WIb6ZyS+7J/lYOVIYFG0v6SL/CdHHm03GhxxuHkIcRw9kEtH0y 6cMw== X-Gm-Message-State: AOAM532Ie5HkBe/FpXs4IPZV517nhsp84YTrnraWZt+1rVDfApXwm+FB 4n6LBwdQVkdvn1fiEZGPPoMN//QCQaSiqw== X-Google-Smtp-Source: ABdhPJxWTix567eQ9ZuYPnszRKFZXHCVoPqD4hoAuuBwPwPavcsqMr/HGu0ZVc4+O2bxI9c9DDAu2Q== X-Received: by 2002:a7b:c4d2:0:b0:37b:b47c:4a5f with SMTP id g18-20020a7bc4d2000000b0037bb47c4a5fmr18907977wmk.102.1645383332861; Sun, 20 Feb 2022 10:55:32 -0800 (PST) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id p27sm12114780wms.1.2022.02.20.10.55.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Feb 2022 10:55:32 -0800 (PST) Message-ID: <22242169-a16d-5261-696c-3cf00b00336a@gmail.com> Date: Sun, 20 Feb 2022 18:55:31 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-GB To: PHP Internals Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [RFC] Deprecate and Remove utf8_encode and utf8_decode From: rowan.collins@gmail.com (Rowan Tommins) 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]