Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113648 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62740 invoked from network); 21 Mar 2021 16:00:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Mar 2021 16:00:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 783C71804B7 for ; Sun, 21 Mar 2021 08:55:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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, 21 Mar 2021 08:55:07 -0700 (PDT) Received: by mail-io1-f42.google.com with SMTP id z136so11357694iof.10 for ; Sun, 21 Mar 2021 08:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benramsey.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=4Ad5b+TNZ197YfUDw7yUt4E1YdgxKrbiqOZCdftIyZg=; b=BZ9UidF08B0pHwsAEzgGiBGx8TbGYjuowrpNQLdPQ1vJ6TMJZKKv5SvoWLm+yUCtW0 UQvOZXiUsNIQ/gNFW/TYVb77KEpUo/3SIHP/LAy6er/9K0FZh63Xs0Nc41sX72bqhrjz EFyTpXSGz/q7ybj7+LRM4u2bGM1PQ2Ne4ntnic0Zx9uHqpKZDNH8HnMDLONLEHPhiIAl l57Com02mDy6AbZkDwM+EghmpYJt00t/5OlczfPcz1S/2E65n999hz+BZ2txIsBh3Hyv mOTitzeBcQjFw1SnS/8BuAkE6VfDwcMgCVRRG9LCW9NEcHv6CbDihaaeSM46FIHjl/bz TQ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=4Ad5b+TNZ197YfUDw7yUt4E1YdgxKrbiqOZCdftIyZg=; b=Wed0+OYN9br92sm/CFbhzFE9yKqaQukgen8M1vS8vUBCLXuO7PB1KyRo7yLzJe5rIk 1gW7Nq0XS+2NgzA/ecrUq9+EQt2qhpMkIjf28l1kOtW+UgvJqSiRr5vo8UmwGCVzfW5X /2QcKcxDK9d5Cs82EwHrygx4yaU2TL8hrSAWZWw3u0Ggwopn15OL3zAOVnvEedsAjkxb zrjfEVCFwzojEeySG+z8cufGTl1jn0nXfVjIrgunCQOIVtKHOK4i1oFS3JAesuAVTbbc 1iWhlPjehqoaPwEqcxtD9UIYq4JHdwx5Mi2etNWOi/R09dh2iCuFnbh6ZTKYlDT5+jAp JbXg== X-Gm-Message-State: AOAM532b2c3LezCjukS3y69VBMUpn5uGiG+5UyL2tnAqz1pnPzR027+O CJhHwDDTfRkca32YMuz4arHK+w== X-Google-Smtp-Source: ABdhPJypryaOLZTB7Ll+QlRpKyP2OGN0NjCDYVDclimzfiz61qpQBcWAh/CjCDNF3wYI5y/gHz5K7A== X-Received: by 2002:a6b:630b:: with SMTP id p11mr8507360iog.140.1616342106569; Sun, 21 Mar 2021 08:55:06 -0700 (PDT) Received: from [10.10.42.56] ([96.61.105.82]) by smtp.gmail.com with ESMTPSA id 13sm6233236ioz.40.2021.03.21.08.55.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Mar 2021 08:55:05 -0700 (PDT) Message-ID: <44640470-3BC3-4845-BE2B-97CCCA942D41@benramsey.com> Content-Type: multipart/signed; boundary="Apple-Mail=_DFE42DB5-AF53-497E-93CB-A57B36D3D2D6"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Date: Sun, 21 Mar 2021 10:55:04 -0500 In-Reply-To: Cc: Rowan Tommins , PHP Internals To: Benjamin Morel References: X-Mailer: Apple Mail (2.3654.60.0.2.21) Subject: Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode? From: ben@benramsey.com (Ben Ramsey) --Apple-Mail=_DFE42DB5-AF53-497E-93CB-A57B36D3D2D6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 21, 2021, at 09:32, Benjamin Morel = wrote: >=20 > On Sun, 21 Mar 2021 at 15:18, Rowan Tommins = wrote: >=20 >> I can see three ways forward: >>=20 >> A) Raise a deprecation notice in 8.1, and remove in 9.0. Do not = provide >> a specific replacement, but recommend people look at iconv() or >> mb_convert_encoding(). There is precedent for this, such as >> convert_cyr_string(), but it may frustrate those who are using the >> functions correctly. >>=20 >> B) Introduce new names, such as utf8_to_iso_8859_1 and >> iso_8859_1_to_utf8; immediately make those the primary names in the >> manual, with utf8_encode / utf8_decode as aliases. Raise deprecation >> notices for the old names, either immediately or in some future = release. >> This gives a smoother upgrade path, but commits us to having these >> functions as outliers in our standard library. >>=20 >=20 > Hi, I'm personally fine with A or B, both of which have pros & cons: >=20 > - A is probably the cleanest way as, as you said, these functions = should > never have existed (locked to a single encoding that will only benefit = a > portion of users), but that's quite a BC break > - B has is less of a BC break as it gives users a chance to rename = their > function calls, but leaves an oddity in the standard library >=20 > I'm a bit worried that either way, we'll start seeing some "polyfills" > appear on Packagist to re-introduce the old functions, but at least = they > will be gone from the core. I prefer option A, and the emergence of userland polyfills doesn=E2=80=99t= worry me. IMO, that=E2=80=99s the right way for the community to handle the BC = break. Cheers, Ben --Apple-Mail=_DFE42DB5-AF53-497E-93CB-A57B36D3D2D6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCYFdsWAAKCRCwLZeYnIwH G0m9AP9jCcAh08m7X4MuJnHJmgVBkwosdHwww7crePxA/oFMxgD9G6Q8y3XW6OVB MpoQx3XnHxfNBxyM5+Elvkvfg9oduPA= =S3LW -----END PGP SIGNATURE----- --Apple-Mail=_DFE42DB5-AF53-497E-93CB-A57B36D3D2D6--