From 64c346deb9132a8cefc1ce79050256cfc64fcc72 Mon Sep 17 00:00:00 2001 From: Marijn Kruisselbrink Date: Fri, 3 Feb 2017 16:05:21 -0800 Subject: [PATCH] Use Encoding's "UTF-8 encode" hook. This is nicer than referencing the utf-8 encoding directly. This fixes #37 --- index.bs | 6 +++--- index.html | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/index.bs b/index.bs index 7779b22..fc570de 100644 --- a/index.bs +++ b/index.bs @@ -266,7 +266,7 @@ user agents must run the following steps: 1. Let |element| be the |i|th element of |a|. 2. If |element| is a {{USVString}}, run the following substeps: - 1. Encode |s| as utf-8 and append the resulting bytes to |bytes|. + 1. Append the result of [=UTF-8 encoding=] |s| to |bytes|. Note: The algorithm from WebIDL [[WebIDL]] replaces unmatched surrogates in an invalid utf-16 string with U+FFFD replacement characters. @@ -567,7 +567,7 @@ user agents must run the following steps: 1. Let |element| be the |i|'th element of |a|. 2. If |element| is a {{USVString}}, run the following substeps: - 1. Encode |s| as utf-8 and append the resulting byte to |bytes|. + 1. Append the result of [=UTF-8 encoding=] |s| to |bytes|. Note: The algorithm from WebIDL [[WebIDL]] replaces unmatched surrogates in an invalid utf-16 string with U+FFFD replacement characters. Scenarios exist when the {{Blob}} constructor may result in some data loss due to lost or scrambled character sequences. @@ -1235,7 +1235,7 @@ the following encoding determination step
If blob has a {{Blob/type}} attribute of text/plain;charset=utf-8 - then getting an encoding is run using utf-8 as the label. + then getting an encoding is run using "utf-8" as the label. Note that user agents must parse and extract the portion of the Charset Parameter that constitutes a label of an encoding.
5. If the getting an encoding steps above return failure, diff --git a/index.html b/index.html index 994099e..50aec08 100644 --- a/index.html +++ b/index.html @@ -1424,7 +1424,7 @@

File API

-

Editor’s Draft,

+

Editor’s Draft,

This version: @@ -1806,7 +1806,7 @@

USVString, run the following substeps:

  1. -

    Encode s as utf-8 and append the resulting bytes to bytes.

    +

    Append the result of UTF-8 encoding s to bytes.

    Note: The algorithm from WebIDL [WebIDL] replaces unmatched surrogates in an invalid utf-16 string with U+FFFD replacement characters. Scenarios exist when the Blob constructor may result in some data loss @@ -2079,7 +2079,7 @@

    USVString, run the following substeps:

    1. -

      Encode s as utf-8 and append the resulting byte to bytes.

      +

      Append the result of UTF-8 encoding s to bytes.

    Note: The algorithm from WebIDL [WebIDL] replaces unmatched surrogates in an invalid utf-16 string with U+FFFD replacement characters. Scenarios exist when the Blob constructor may result in some data loss due to lost or scrambled character sequences.

    @@ -2710,7 +2710,7 @@

    6. and the blob argument’s type attribute is present, and it uses a Charset Parameter [RFC2046], set encoding to the result of getting an encoding for the portion of the Charset Parameter that is a label of an encoding.

    -
    If blob has a type attribute of text/plain;charset=utf-8 then getting an encoding is run using utf-8 as the label. +
    If blob has a type attribute of text/plain;charset=utf-8 then getting an encoding is run using "utf-8" as the label. Note that user agents must parse and extract the portion of the Charset Parameter that constitutes a label of an encoding.
  2. If the getting an encoding steps above return failure, @@ -3670,7 +3670,7 @@

  3. decode
  4. getting an encoding -
  5. utf-8 +
  6. utf-8 encode
  7. [Fetch] defines the following terms: