Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113646 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51227 invoked from network); 21 Mar 2021 14:37:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Mar 2021 14:37:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D3E651804C0 for ; Sun, 21 Mar 2021 07:32:51 -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,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 07:32:51 -0700 (PDT) Received: by mail-oi1-f174.google.com with SMTP id d12so10358174oiw.12 for ; Sun, 21 Mar 2021 07:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L5k8iI4RaZbdb8E8V23OQaqxf1XsW/Us0bcRSmlM/Pw=; b=dKDvYHNG1e0UaMcUqccG4bgyL2vAeNE6jbQ5SEuMP18D4vPuBJVTwddDTT4Q2VpNKP cURce7z98ZvYSu5BgWZ0uEe802qgQosQ7pMozwGrCray+x0zNk/9My/e/GUrWo9Z9zL0 ak24C8ld3my0xJXhPBgBAcR13TZXOWybaEku3qS/VqZPvX7R3oPgTsu8ybRkjVoeLcpc uM/PQp4n6qf40x0Aheh4TR/maPbmdB5uu+h9HAx+yoKEgOWkUYwd1p+P16Q4laW5YU/C +aS7lwcVLp7afWf3Rr4Ua7knXRT0UyYhQhPtynsvvahjp9yTZ22uWR9Npax0fsa/7mbQ YloA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L5k8iI4RaZbdb8E8V23OQaqxf1XsW/Us0bcRSmlM/Pw=; b=fyRey4S6ZjrTnE3UTQhanztJE1ZybIY9OknYGoBTKnQIxN6JIuaV63KBdnbsGrfbOy Tg+lRfE1drQACoj6irl/k0pxfWt3s7ceFaeVuQ4Ij+5zqloccgExh1glrDxrBVmMy5VN 8pZzR4ZMeeERohYN5SuKkJWZswrE9zJZwHaqu5LS5pprd4bWK5C2WvQyb8d7SdnQ34xQ 3nlKRGggi16p0ROhywLauwbQWnH4Cl5i8sGNZ8gW51xkOKVOyJSPSqvmYRj9rx0TXEO9 rA1tykD+BmHiJpoYxMb5NlBFTjlLQSL+wbqPNzUrqlUDqa7SFmdirlyLq/B6+AZgnwmC yoLg== X-Gm-Message-State: AOAM530wxwcXxz7AGo2Y8eHmx/Gp9qTSFnADYNeG4mKfGytnfqJrcCeo yd2CFkltvRp5pFuPuN8FheSQ113r3te+bxbPmmA= X-Google-Smtp-Source: ABdhPJz/cQ+54SpXYz7IG+tRh3GuBBs7O2C7DtRHG5tstm4LqZCw0xVP8Mq6HLV48mF4ryXV678r7+gnT9foTd0g4bE= X-Received: by 2002:aca:db05:: with SMTP id s5mr6781509oig.134.1616337167838; Sun, 21 Mar 2021 07:32:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 21 Mar 2021 15:32:36 +0100 Message-ID: To: Rowan Tommins Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000b9f3d105be0cd254" Subject: Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode? From: benjamin.morel@gmail.com (Benjamin Morel) --000000000000b9f3d105be0cd254 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 21 Mar 2021 at 15:18, Rowan Tommins wrote= : > I can see three ways forward: > > 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. > > 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. > Hi, I'm personally fine with A or B, both of which have pros & cons: - 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 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. =E2=80=94 Benjamin --000000000000b9f3d105be0cd254--