From 68aad5d0653a4c8e560428788531809d72ffb2b6 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 8 May 2020 08:27:24 +0200 Subject: [PATCH] Editorial: minor tweaks to percent-encoded bytes Helps with #296. --- url.bs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/url.bs b/url.bs index 89f9b118..de68c188 100644 --- a/url.bs +++ b/url.bs @@ -116,17 +116,17 @@ error.

Percent-encoded bytes

A percent-encoded byte is U+0025 (%), followed by two ASCII hex digits. -Sequences of percent-encoded bytes, after conversion to bytes, +Sequences of percent-encoded bytes, string percent decoded, should not cause UTF-8 decode without BOM or fail to return failure. -

To percent encode a byte into a percent-encoded byte, return -a string consisting of U+0025 (%), followed by two ASCII upper hex digits representing -byte. +

To percent encode a byte byte, return a +string consisting of U+0025 (%), followed by two ASCII upper hex digits +representing byte.

To percent decode a byte sequence input, run these steps: -

Using anything but UTF-8 decode without BOM when the input -contains bytes that are not ASCII bytes might be insecure and is not recommended. +

Using anything but UTF-8 decode without BOM when input contains +bytes that are not ASCII bytes might be insecure and is not recommended.

  1. Let output be an empty byte sequence. @@ -170,12 +170,6 @@ contains bytes that are not ASCII bytes might be insecure and is not reco


    -

    The C0 control percent-encode set are the C0 controls and all code points greater than U+007E (~). @@ -189,8 +183,8 @@ U+0020 SPACE, U+0022 ("), U+003C (<), U+003E (>), and U+0060 (`). path percent-encode set and U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@), U+005B ([) to U+005E (^), inclusive, and U+007C (|). -

    To UTF-8 percent encode a codePoint, using a percentEncodeSet, -run these steps: +

    To UTF-8 percent encode a code point codePoint, using a +percentEncodeSet, run these steps:

    1. If codePoint is not in percentEncodeSet, then return @@ -203,6 +197,10 @@ run these steps: concatenated, in the same order.

    +

    The application/x-www-form-urlencoded format's +byte serializer and the URL parser's +query state use percent encode directly. +

    Security considerations