note 76581 added to function.json-decode
| From: | AMA3 at osu1 dot php dot net | Date: | Sat, 21 Jul 2007 01:02:56 +0000 |
| Subject: | note 76581 added to function.json-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128787@lists.php.net to get a copy of this message | ||
phpben at hood dot id dot au wrote:
> AFAICT. The JSON docs seem to say that '"','/' and '\' must
> be quoted with a '\'
At first glance, it seems that way, but if you read the RFC (4627) carefully, forward-slash (/)
*may* be escaped but need not be. Specifically, Section 2.5 defines the following:
string = quotation-mark *char quotation-mark
char = unescaped / ...
unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
Forward slash falls in the second range of unescaped characters, at %x2F.
It's strange that forward-slash is permitted to be escaped but not required to be, and that it
has the same meaning either way, but that's how it's written, and so shall it be.
FMI: http://www.ietf.org/rfc/rfc4627.txt
----
Server IP: 64.71.164.2
Probable Submitter: 75.196.225.97
----
Manual Page -- http://www.php.net/manual/en/function.json-decode.php
Edit -- https://master.php.net/note/edit/76581
Del: integrated -- https://master.php.net/note/delete/76581/integrated
Del: useless -- https://master.php.net/note/delete/76581/useless
Del: bad code -- https://master.php.net/note/delete/76581/bad+code
Del: spam -- https://master.php.net/note/delete/76581/spam
Del: non-english -- https://master.php.net/note/delete/76581/non-english
Del: in docs -- https://master.php.net/note/delete/76581/in+docs
Del: other reasons-- https://master.php.net/note/delete/76581
Reject -- https://master.php.net/note/reject/76581
Search -- https://master.php.net/manage/user-notes.php