diff --git a/encoding.bs b/encoding.bs index b5a539d..81f43b6 100644 --- a/encoding.bs +++ b/encoding.bs @@ -112,6 +112,7 @@ present in I/O queues of any type and it signifies that there are n in parallel instead. +

To read an item from an I/O queue ioQueue, run these steps: @@ -123,7 +124,9 @@ present in I/O queues of any type and it signifies that there are n

  • Remove ioQueue[0] and return it. +

  • +

    To read a number number of items from ioQueue, run these steps: @@ -143,7 +146,9 @@ present in I/O queues of any type and it signifies that there are n

  • Return readItems. +

  • +

    To peek a number number of items from an I/O queue ioQueue, run these steps: @@ -166,7 +171,9 @@ from an I/O queue ioQueue, run these steps:

  • Return prefix. +

  • +

    To push an item item to an I/O queue ioQueue, run these steps: @@ -184,25 +191,33 @@ from an I/O queue ioQueue, run these steps:

  • Otherwise, append item to ioQueue. +

  • +

    To push a sequence of items to an I/O queue ioQueue is to push each item in the sequence to ioQueue, in the given order. +

    +

    To restore an item other than end-of-queue to an I/O queue, perform the list prepend operation. To restore a list of items excluding end-of-queue to an I/O queue, insert those items, in the given order, before the first item in the queue. +

    Inserting the bytes « 0xF0, 0x9F » in an I/O queue « 0x92 0xA9, end-of-queue », results in an I/O queue « 0xF0, 0x9F, 0x92 0xA9, end-of-queue ». The next item to be read would be 0xF0. +

    To convert an I/O queue ioQueue into a list, string, or byte sequence, return the result of reading an indefinite number of items from ioQueue. +

    +

    To convert a list, string, or byte sequence input into an I/O queue, run these steps: @@ -213,6 +228,7 @@ items, in the given order, before the first item in the queue.

  • Return an I/O queue containing the items in input, in order, followed by end-of-queue. +

  • The Infra standard is expected to define some infrastructure around type conversions. See whatwg/infra issue #319. [[INFRA]] @@ -225,10 +241,11 @@ algorithms, as detailed in [[#implementation-considerations]].


    +

    To obtain a scalar value from surrogates, given a leading surrogate leading and a trailing surrogate trailing, return 0x10000 + ((leading − 0xD800) << 10) + (trailing − 0xDC00). - +

    Encodings

    @@ -275,6 +292,7 @@ to silent data loss. Developers are strongly encouraged to use the UTF-8
    +

    To process a queue given an encoding's decoder or encoder instance encoderDecoder, I/O queue input, I/O queue @@ -292,7 +310,9 @@ given an encoding's decoder or encoder in

  • If result is not continue, then return result. +

  • +

    To process an item given an item item, encoding's encoder or decoder instance encoderDecoder, I/O queue input, @@ -350,6 +370,7 @@ given an item item, encoding's

  • Return continue. +

  • Names and labels

    @@ -371,6 +392,7 @@ or labels. as "utf-8". +

    To get an encoding from a string label, run these steps: @@ -382,6 +404,7 @@ from a string label, run these steps:

  • If label is an ASCII case-insensitive match for any of the labels listed in the table below, then return the corresponding encoding; otherwise return failure. +

  • This is a more basic and restrictive algorithm of mapping labels to encodings than @@ -889,6 +912,7 @@ specification, excluding index single-byte, which have their own table: ISO-2022-JP encoder. [[UNICODE]] +

    The index gb18030 ranges code point for pointer is the return value of these steps: @@ -906,7 +930,9 @@ the return value of these steps:

  • Return a code point whose value is code point offset + pointeroffset. +

  • +

    The index gb18030 ranges pointer for code point is the return value of these steps: @@ -920,7 +946,9 @@ the return value of these steps:

  • Return a pointer whose value is pointer offset + code pointoffset. +

  • +

    The index Shift_JIS pointer for code point is the return value of these steps: @@ -937,7 +965,9 @@ steps:

  • Return the index pointer for code point in index. +

  • +

    The index Big5 pointer for code point is the return value of these steps: @@ -960,6 +990,7 @@ these steps:

  • Return the index pointer for code point in index. +


  • @@ -994,6 +1025,7 @@ different format here, to be able to represent ranges.) end-of-queue item from ever being pushed into the output I/O queue. +

    To UTF-8 decode an I/O queue of bytes ioQueue given an optional I/O queue of scalar values output (default « »), run these steps: @@ -1009,7 +1041,9 @@ queue of scalar values output (default « »), run these steps:

  • Return output. +

  • +

    To UTF-8 decode without BOM an I/O queue of bytes ioQueue given an optional I/O queue of scalar values output (default « »), run these steps: @@ -1019,7 +1053,9 @@ optional I/O queue of scalar values output (default « »), run these

  • Return output. +

  • +

    To UTF-8 decode without BOM or fail an I/O queue of bytes ioQueue given an optional I/O queue of scalar values output (default « »), run these steps: +

    +

    The encodeInto(source, destination) method steps are: @@ -1659,6 +1727,7 @@ function convertString(buffer, input, callback) { }

    +

    Interface {{TextDecoderStream}}

    @@ -1719,6 +1788,7 @@ byteReadable {{TypeError}}. +

    The new TextDecoderStream(label, options) constructor steps are: @@ -1756,7 +1826,9 @@ constructor steps are:

  • Set this's transform to transformStream. +

  • +

    The decode and enqueue a chunk algorithm, given a {{TextDecoderStream}} object decoder and a chunk, runs these steps: @@ -1803,7 +1875,9 @@ constructor steps are:

  • If result is error, then throw a {{TypeError}}. +

  • +

    The flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{TextDecoderStream}} object decoder, runs these steps: @@ -1842,6 +1916,7 @@ steps: +

    Interface {{TextEncoderStream}}

    @@ -1895,6 +1970,7 @@ textReadable .pipeTo(byteWritable); +

    The new TextEncoderStream() constructor steps are: @@ -1919,9 +1995,11 @@ constructor steps are:

  • Set this's transform to transformStream. +


  • +

    The encode and enqueue a chunk algorithm, given a {{TextEncoderStream}} object encoder and chunk, runs these steps: @@ -1973,7 +2051,9 @@ constructor steps are: output, and "fatal". +

    +

    The convert code unit to scalar value algorithm, given a {{TextEncoderStream}} object encoder, a code unit item, and an I/O queue of code units input, runs these steps: @@ -2007,7 +2087,9 @@ constructor steps are:

    This is equivalent to the "convert a string into a scalar value string" algorithm from the Infra Standard, but allows for surrogate pairs that are split between strings. [[!INFRA]] +

    +

    The encode and flush algorithm, given a {{TextEncoderStream}} object encoder, runs these steps: @@ -2026,6 +2108,7 @@ that are split between strings. [[!INFRA]] transform. +