Req #72831 [Opn]: Add encoding option for chr and ord
| From: | requinix@php.net | Date: | Sun, 14 Aug 2016 04:18:07 +0000 |
| Subject: | Req #72831 [Opn]: Add encoding option for chr and ord | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203248@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: requinix@php.net
Reported by: masakielastic at gmail dot com
-Summary: The encoding option for chr and ord
+Summary: Add encoding option for chr and ord
Status: Open
Type: Feature/Change Request
Package: Strings related
PHP Version: Next Minor Version
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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