Re: ord(), chr(), and &url.asciitbale.com;
| From: | Rowan Collins | Date: | Fri, 22 Jun 2018 21:11:01 +0000 |
| Subject: | Re: ord(), chr(), and &url.asciitbale.com; | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969386979@lists.php.net to get a copy of this message | ||
Hi Christoph!
On 22/06/2018 11:48, Christoph M. Becker wrote:
On 10.06.2018 at 19:59, Rowan Collins wrote:Thanks, I'm glad you like the general direction. I agree that the <refpurpose> lines are a bit weak; I really struggled to think of a short description that wasn't misleading. Would "Gets the numeric byte value of the first byte of a string" and "Generates a single-byte string based on a numeric byte value" be any better, or is that still a bit vague? I really wanted to avoid words like "character", which will make people think of character sets, and Unicode characters, etc; but maybe that makes it rather too abstract, and we should just hope people will read far enough down to see what "character" means in this context...I'd like to raise a discussion of the patch I've just proposed at https://edit.php.net/?patchID=2939&project=PHP because it's a relatively major change.Thanks. In my opinion, this is an overall improvement! However, I'm not happy with the <refpurpose>s which appear to be far too general.
Regarding the changed parameter name: we should actually use the names which are returned by Reflection, which is $codepoint for chr() (cf. <https://3v4l.org/CrcS2>).Aha, I did wonder if there was a convention for that, but didn't think of checking reflection. That gives us "character" for ord() and "codepoint" for chr(), which definitely aren't the names I'd choose, but they're better than "ascii", I guess.
If we can't think of a better link, I think that would be less misleading, yes; how many PHP programmers are going to be working in Code Page 437? Thanks for the feedback! -- Rowan Collins [IMSoP]Finally, both pages currently link to http://www.asciitable.com which has a reasonable table for ASCII values, and then one labelled "extended ASCII", which appears to be the top half of DOS Code Page 437, of all things. I think this should be replaced with a more suitable link, but I'm not sure where to; Wikipedia has good charts of encodings, for instance, but what page would we link to? ASCII, ISO-8859-1, Windows 1252, something else?Good question! Maybe we should remove the link altogether?