Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113675 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70927 invoked from network); 22 Mar 2021 15:39:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Mar 2021 15:39:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2EDE81804F4 for ; Mon, 22 Mar 2021 08:35:00 -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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 ; Mon, 22 Mar 2021 08:34:59 -0700 (PDT) Received: by mail-ed1-f49.google.com with SMTP id e7so19822149edu.10 for ; Mon, 22 Mar 2021 08:34:59 -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=iH6EDqtEdYC59wAPzd8E3HiF4iyzBUaMTDOYo+LqVX0=; b=EdCTfn1T1CwLVkKgaBaMXFdcZS27ykdedEEWZiOsZvE90npde6t1SQCQDv7PWMDGJW 2neMcTvnatnyHt5DaP8K1qq2udJ5iX3tKQ0or/sqZVgcaz3J+GmzbhmHkngH7nK3uyKW vrrBvpTulO9BgHwXSL9snqwsuq0Z2Q+S2cooEb/CLtcjIihCWuLlnV0LB2GliEHJF9wB srPwwcfJisScWPxfofssr/lGeOhFmD1jspQQIYu7hJ19ReQicIOmh4cjRGeRpXQrXyNk cm3V8+RShhE+WRINS0dfNxc3AfXz+NFMogK3TuQ9ru5/radl0Xzj3qzweFP3LWNRyufE ag+w== 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=iH6EDqtEdYC59wAPzd8E3HiF4iyzBUaMTDOYo+LqVX0=; b=tRqjUYlJtdYsB0U1Tehae9lrWPMyHiYHJCbu2pI7Kwool+fLrs7mE5Wim0+k45d093 YXLj6MLifWhfIJrbMjNopkz0cqlDqjMGXn2nsSMNgPa5OVWnz8UnuWAyvf+9W09HIJGF CBJrAbUY7nOXbBIp3bMVEJBuHDPo/+uaBpagOc01jOwVrjXi71OLsr5htq+5JQoHxGN8 8pDS3saI/tH0MXblKN8E7HLhJFGlzP31jcZzr9eSJ0FtaQ9phTqFaXhTc8ZtXEE/vnLH u0LpUULhHEDHNz399AF6oTqZUzgEh1nSZXDK4xHfkarLA19JF4pHGZjZBXm+qHbxcwEC 1yKg== X-Gm-Message-State: AOAM5304403BNQRRd26TBjT2zeWIsm4UrIUvip44DEjfLdQwQKuEsdm3 sONEJhy13csh+6YeCrtnicx3N6Tu10fEYFM2ZYs= X-Google-Smtp-Source: ABdhPJxocBK2otT/FfnujxrWEmfT7LeqqjLFzKp7WCltYPAaE2vWaLCvQQBX8Zg7+iP8Iknf0kxoP4KQ42l2o7cB0Ak= X-Received: by 2002:aa7:c88e:: with SMTP id p14mr92978eds.119.1616427298306; Mon, 22 Mar 2021 08:34:58 -0700 (PDT) MIME-Version: 1.0 References: <693767b5-a25b-b4d9-f535-6b985bf26d67@gmail.com> <29d5329c-bea2-7944-4820-515d4a10ae86@alec.pl> In-Reply-To: <29d5329c-bea2-7944-4820-515d4a10ae86@alec.pl> Date: Mon, 22 Mar 2021 15:34:49 +0000 Message-ID: To: Aleksander Machniak Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000ebbf0d05be21ce9a" Subject: Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode? From: tekiela246@gmail.com (Kamil Tekiela) --000000000000ebbf0d05be21ce9a Content-Type: text/plain; charset="UTF-8" > > I'm using utf8_encode()/utf8_decode() to make input string safe to be > stored in DB, and back. In most cases the input is utf-8, but it > occasionally may contain "broken characters". > What exactly do you mean by making the input string safe? If I understand correctly utf8_decode(utf8_encode($str)) should just be an identity function. Could you please explain what is the purpose of using these functions in such a way? --000000000000ebbf0d05be21ce9a--