From: Tomek Mrugalski Date: Thu, 2 Feb 2017 12:46:07 +0000 (+0100) Subject: [5105] Updated examples and User's Guide to match double escapes. X-Git-Tag: trac3590_base~1^2~2^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3201a422f071edd93ae0295cd8e41fb00c6227ab;p=thirdparty%2Fkea.git [5105] Updated examples and User's Guide to match double escapes. --- diff --git a/doc/examples/kea4/multiple-options.json b/doc/examples/kea4/multiple-options.json index c5d284427d..1d18d0025f 100644 --- a/doc/examples/kea4/multiple-options.json +++ b/doc/examples/kea4/multiple-options.json @@ -47,11 +47,13 @@ }, { // String options that have a comma in their values need to have - // it escaped (i.e. each comma is predeced by a backslash). That's + // it escaped (i.e. each comma is predeced by two backslashes). That's // because commas are reserved for separating fields in compound - // options. + // options. At the same time, we need to be conformant with JSON spec, + // that does not allow "\,". Therefore the slightly uncommon double + // backslashes natation is needed. "name": "boot-file-name", - "data": "EST5EDT4\,M3.2.0/02:00\,M11.1.0/02:00" + "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00" } ] } diff --git a/doc/examples/kea6/multiple-options.json b/doc/examples/kea6/multiple-options.json index 3677da4c29..75fd517bda 100644 --- a/doc/examples/kea6/multiple-options.json +++ b/doc/examples/kea6/multiple-options.json @@ -52,9 +52,11 @@ }, { // String options that have a comma in their values need to have - // it escaped (i.e. each comma is predeced by a backslash). That's + // it escaped (i.e. each comma is predeced by two backslashes). That's // because commas are reserved for separating fields in compound - // options. + // options. At the same time, we need to be conformant with JSON spec, + // that does not allow "\,". Therefore the slightly uncommon double + // backslashes natation is needed. "name": "new-posix-timezone", "data": "EST5EDT4\,M3.2.0/02:00\,M11.1.0/02:00" } diff --git a/doc/guide/dhcp4-srv.xml b/doc/guide/dhcp4-srv.xml index f21ee4b2e2..7c21acfc28 100644 --- a/doc/guide/dhcp4-srv.xml +++ b/doc/guide/dhcp4-srv.xml @@ -1018,8 +1018,9 @@ temporarily override a list of interface names and listen on all interfaces. When the data field is a string, and that string contains the comma - (,; U+002C) character, the comma must be escaped with a reverse solidus - character (\; U+005C). For example, the string + (,; U+002C) character, the comma must be escaped with a double reverse solidus + character (\; U+005C). This double escape is required, because a + single escape (\,) would make the JSON invalid. For example, the string "foo,bar" would be represented as: "Dhcp4": { @@ -1030,7 +1031,7 @@ temporarily override a list of interface names and listen on all interfaces. "option-data": [ { "name": "boot-file-name", - "data": "foo\,bar" + "data": "foo\\,bar" } ] }, diff --git a/doc/guide/dhcp6-srv.xml b/doc/guide/dhcp6-srv.xml index 89a731767c..aa0ac27a66 100644 --- a/doc/guide/dhcp6-srv.xml +++ b/doc/guide/dhcp6-srv.xml @@ -1050,9 +1050,12 @@ temporarily override a list of interface names and listen on all interfaces. which was not assigned by IANA) are listed in . - When the data field is a string, and that string contains the comma - (,; U+002C) character, the comma must be escaped with a reverse solidus - character (\; U+005C). For example, the string "EST5EDT4,M3.2.0/02:00,M11.1.0/02:00" would be + When the data field is a string, and that string contains + the comma (,; U+002C) character, the comma must be escaped with a + reverse solidus character (\; U+005C). This double escape is + required, because a single escape (\,) would make the JSON + invalid. For example, the string + "EST5EDT4,M3.2.0/02:00,M11.1.0/02:00" would be represented as: "Dhcp6": {