diff --git a/url.bs b/url.bs index 3f41924b..c4ec29d8 100644 --- a/url.bs +++ b/url.bs @@ -183,7 +183,11 @@ 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 code point codePoint, using a +

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

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

    @@ -197,9 +201,17 @@ U+005B ([) to U+005E (^), inclusive, and U+007C (|). 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. +

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

    +
  1. Let output be the empty string.

  2. + +
  3. For each codePoint of input, UTF-8 percent encode + codePoint using percentEncodeSet and append the result to output. + +

  4. Return output. +

@@ -816,12 +828,8 @@ then runs these steps:
  • If input contains a U+0025 (%) and the two code points following it are not ASCII hex digits, validation error. -

  • Let output be the empty string. - -

  • For each code point in input, UTF-8 percent encode it using the - C0 control percent-encode set, and append the result to output. - -

  • Return output. +

  • Return the result of running string UTF-8 percent encode on input using + the C0 control percent-encode set. @@ -2371,26 +2379,14 @@ string input, optionally with a base URL base, opti


    To set the username given a url and -username, run these steps: - -

      -
    1. Set url's username to the empty string. - -

    2. For each code point in username, UTF-8 percent encode it using the - userinfo percent-encode set, and append the result to url's - username. -

    +username, set url's username to the result of running +string UTF-8 percent encode on username using the +userinfo percent-encode set.

    To set the password given a url and -password, run these steps: - -

      -
    1. Set url's password to the empty string. - -

    2. For each code point in password, UTF-8 percent encode it using the - userinfo percent-encode set, and append the result to url's - password. -

    +password, set url's password to the result of running +string UTF-8 percent encode on password using the +userinfo percent-encode set.

    URL serializing