Req #72831 [Opn->Csd]: Add encoding option for chr and ord
| From: | krakjoe@php.net | Date: | Mon, 09 Jan 2017 05:35:55 +0000 |
| Subject: | Req #72831 [Opn->Csd]: Add encoding option for chr and ord | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206420@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72831&edit=1
ID: 72831
Updated by: krakjoe@php.net
Reported by: masakielastic at gmail dot com
Summary: Add encoding option for chr and ord
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: Strings related
PHP Version: Next Minor Version
-Assigned To:
+Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
Since this requires an RFC, and there is a PR open on github, closing this issue.
Previous Comments:
------------------------------------------------------------------------
[2016-08-14 04:18:05] requinix@php.net
Since this involves character encoding I suggest you mention it on the internals mailing list. http://php.net/mailing-lists.php Not that I would expect
it to require an RFC, but (a) mbstring's age factors into this and (b) such changes could be
useful for IntlChar too. There's room for discussion about the issue as a whole, not just the
modifications to chr and ord.
One thing to mention now: the default should be according to the default_charset setting
(http://php.net/manual/en/ini.core.php#ini.default-charset) as is done with a few other functions.
------------------------------------------------------------------------
[2016-08-14 03:52:33] masakielastic at gmail dot com
Description:
------------
This proposal is about adding the encoding option for chr and ord.
string chr ( int $codepoint [, string $encoding = "ISO-8859-1"] )
int ord ( string $string [, string $encoding = "ISO-8859-1"] )
The conversion between character and codepoint can be widely seen in learning Unicode spec, escaping
dangerous characters for security, replacing emoji with image for legacy smartphone.
Although intl and mbstring module have the conversion feature (IntlChar::chr, IntlChar::ord, mb_chr,
mb_ord), A lot of people are satisfied with UTF-8 and the developers of frameworks want to reduce
the dependencies of modules. Symfony developers maintain intl and polyfill-mbstring component.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72831&edit=1