Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95367 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73589 invoked from network); 22 Aug 2016 10:46:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Aug 2016 10:46:55 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.48 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.48 mail-wm0-f48.google.com Received: from [74.125.82.48] ([74.125.82.48:37215] helo=mail-wm0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/A4-35246-E18DAB75 for ; Mon, 22 Aug 2016 06:46:55 -0400 Received: by mail-wm0-f48.google.com with SMTP id i5so136968201wmg.0 for ; Mon, 22 Aug 2016 03:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=gxF9ENSlx3SgRn2STRxzlUEw4PAG6ihNiDVk7PBnVJw=; b=gKZh7YF8tKdta7ePEObd1eVN0Fs2nXkUwUSJLFoQGIcHncEGzsTwIwzVG51djWWKWU q1zu7Tps/BhTuO171IKBukjPiYmGwBcKt66SmLMVixAOmGjs+aKh3ixuly16GPozrrBW iraNDu+0lIYXI42nc6jqm/SBfIw7jY3Ii+3gdQIu/D0suO2KCsC6QRANZEiw3rNmsuJ+ RjH0b1ytumMJY0Dh9aHoBiUWp0QWVG28HhOPzjTusURpPbdkrmxnrE2Nl6EBb8R82I71 oFW2nAN2aRe49AvH9M99F0Tys3+pkUHLK2hQDfeDb+cNleTncRpEMfZGF+8rfaHEDSNC q84Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=gxF9ENSlx3SgRn2STRxzlUEw4PAG6ihNiDVk7PBnVJw=; b=QZCrFH5DxULR01Qb+CnH9YgYrLM1KfRWb44lGjwEUOfEVqP9nlRwsQ469CFQ/Q3oRR e3sBSJcbiHlBFIO9ko4xCLwV+7U+Y0k9gEKCjP1jeLDBLbhzFt/LkFOi6h3wPi2VWfOr oHxAW3PhS6VQPpKEdDxWQZ9T7ILkijCZQsNM/2F9Qk4bwuk+UdOVeZRrxeUpD9pCtm6g inwIXX4qJWeybfq6yjNTBSwFJRF/RnnboCXN7rstvUqw8qaM6CuNQptAwZD0RwiRfcY/ HPIOOo9PIBvybkUNWW8PMEvJkwYukV48HryQail5Wzz1QR+hQOi4wbIAoftQ7I0aMrI8 0Wag== X-Gm-Message-State: AEkoousuK2+UmaTOZSrcMN3kKsoTSvmdcBJdayzJ4VLeKqk58hBE/LumQNdZ7bAcrHtyeg== X-Received: by 10.194.75.198 with SMTP id e6mr18161097wjw.31.1471862810774; Mon, 22 Aug 2016 03:46:50 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id r16sm20581606wme.16.2016.08.22.03.46.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2016 03:46:49 -0700 (PDT) References: To: "internals@lists.php.net" Message-ID: <8f77da79-e843-aee0-e68d-e132ada5e782@gmail.com> Date: Mon, 22 Aug 2016 11:44:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Remove utf8_decode() and utf8_encode() From: rowan.collins@gmail.com (Rowan Collins) On 22/08/2016 02:52, Yasuo Ohgaki wrote: > Since these > are XML module functions, the name would be xml_latin1_to_utf8() and > xml_utf8_to_latin1(). Suggestions for names are appreciated. From a user's point of view, these functions have nothing to do with XML, so I'm not sure the prefix really makes sense. I had no idea until a few days ago that they were in the same extension in the source, and I suspect most users aren't even aware that "built-in" functions like this are arranged in "extensions" at all. The naming convention in CODING_STANDARDS [1] doesn't actually make reference to extensions, only a "parent set", so I don't think "xml_" is a mandatory or natural prefix according to that rule. [1] https://github.com/php/php-src/blob/master/CODING_STANDARDS As far as I can see, these functions exist because the XML parser infrastructure needed them, and someone thought it might be handy to expose them to users. Funnily enough, the internal versions actually take a parameter for the target encoding, but only support US-ASCII and 8859-1: https://github.com/php/php-src/blob/master/ext/xml/xml.c#L283 If anything, they should probably have a "str_" prefix, and maybe even be moved into the string section of the source, exposed in such a way that the XML parser can still make use of them. Regards, -- Rowan Collins [IMSoP]