Re: What should we do with utf8_encode and utf8_decode?
| From: | Rowan Tommins | Date: | Mon, 22 Mar 2021 17:54:32 +0000 |
| Subject: | Re: What should we do with utf8_encode and utf8_decode? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-113696@lists.php.net to get a copy of this message | ||
On 22/03/2021 17:38, Alexandru Pătrănescu wrote:
As Rowan mentioned, base64_encode would have worked. But that means one quarter of the available max column space would be lost as a downside.Depending on the data, abusing Latin1-to-UTF8 translation can easily result in a longer string than base64. $str = '🤡🤡'; echo strlen(base64_encode($str)); // 12 echo strlen(utf8_encode($str)); // 16 Regards, -- Rowan Tommins [IMSoP]