|
874 | 874 | "rationale": "if", |
875 | 875 | "steps": [ |
876 | 876 | { |
877 | | - "html": "If <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate\">pending high surrogate</a> is non-null, then:", |
| 877 | + "html": "If <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate\">leading surrogate</a> is non-null, then:", |
878 | 878 | "rationale": "let", |
879 | 879 | "steps": [ |
880 | 880 | { |
881 | | - "html": "<p>Let <var>high surrogate</var> be <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate①\">pending high surrogate</a>. </p>" |
| 881 | + "html": "<p>Let <var>leadingSurrogate</var> be <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate①\">leading surrogate</a>. </p>" |
882 | 882 | }, |
883 | 883 | { |
884 | | - "html": "<p>Set <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate②\">pending high surrogate</a> to null. </p>" |
| 884 | + "html": "<p>Set <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate②\">leading surrogate</a> to null. </p>" |
885 | 885 | }, |
886 | 886 | { |
887 | | - "html": "<p>If <var>item</var> is in the range U+DC00 to U+DFFF, inclusive, then return a scalar value\n whose value is 0x10000 + ((<var>high surrogate</var> − 0xD800) << 10) +\n (<var>item</var> − 0xDC00). </p>" |
| 887 | + "html": "<p>If <var>item</var> is a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#trailing-surrogate\" id=\"ref-for-trailing-surrogate①\">trailing surrogate</a>, then return a <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#scalar-value-from-surrogates\" id=\"ref-for-scalar-value-from-surrogates\">scalar value from surrogates</a> given <var>leadingSurrogate</var> and <var>item</var>. </p>" |
888 | 888 | }, |
889 | 889 | { |
890 | 890 | "html": "<p><a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#concept-stream-prepend\" id=\"ref-for-concept-stream-prepend②\">Restore</a> <var>item</var> to <var>input</var>. </p>" |
|
895 | 895 | ] |
896 | 896 | }, |
897 | 897 | { |
898 | | - "html": "<p>If <var>item</var> is in the range U+D800 to U+DBFF, inclusive, then set <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate③\">pending high\n surrogate</a> to <var>item</var> and return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#continue\" id=\"ref-for-continue③\">continue</a>. </p>" |
| 898 | + "html": "<p>If <var>item</var> is a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#leading-surrogate\" id=\"ref-for-leading-surrogate②\">leading surrogate</a>, then set <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate③\">leading surrogate</a> to <var>item</var> and return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#continue\" id=\"ref-for-continue③\">continue</a>. </p>" |
899 | 899 | }, |
900 | 900 | { |
901 | | - "html": "<p>If <var>item</var> is in the range U+DC00 to U+DFFF, inclusive, then return U+FFFD. </p>" |
| 901 | + "html": "<p>If <var>item</var> is a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#trailing-surrogate\" id=\"ref-for-trailing-surrogate②\">trailing surrogate</a>, then return U+FFFD. </p>" |
902 | 902 | }, |
903 | 903 | { |
904 | 904 | "html": "<p>Return <var>item</var>. </p>" |
|
912 | 912 | "rationale": "if", |
913 | 913 | "steps": [ |
914 | 914 | { |
915 | | - "html": "If <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate④\">pending high surrogate</a> is non-null, then:", |
| 915 | + "html": "If <var>encoder</var>’s <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#textencoderstream-pending-high-surrogate\" id=\"ref-for-textencoderstream-pending-high-surrogate④\">leading surrogate</a> is non-null, then:", |
916 | 916 | "rationale": "let", |
917 | 917 | "steps": [ |
918 | 918 | { |
|
1256 | 1256 | { |
1257 | 1257 | "html": "<p>If <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#gbk-flag\" id=\"ref-for-gbk-flag①\">is GBK</a> is true and <var>code point</var> is\n U+20AC, return byte 0x80. </p>" |
1258 | 1258 | }, |
| 1259 | + { |
| 1260 | + "html": "<p>If there is a row in the table below whose first column is <var>code point</var>, then return\n the two bytes on the same row listed in the second column: </p>\n <table>\n <tbody>\n <tr>\n <th>Code point \n </th><th>Bytes \n </th></tr><tr>\n <td>U+E78D \n </td><td>0xA6 0xD9 \n </td></tr><tr>\n <td>U+E78E \n </td><td>0xA6 0xDA \n </td></tr><tr>\n <td>U+E78F \n </td><td>0xA6 0xDB \n </td></tr><tr>\n <td>U+E790 \n </td><td>0xA6 0xDC \n </td></tr><tr>\n <td>U+E791 \n </td><td>0xA6 0xDD \n </td></tr><tr>\n <td>U+E792 \n </td><td>0xA6 0xDE \n </td></tr><tr>\n <td>U+E793 \n </td><td>0xA6 0xDF \n </td></tr><tr>\n <td>U+E794 \n </td><td>0xA6 0xEC \n </td></tr><tr>\n <td>U+E795 \n </td><td>0xA6 0xED \n </td></tr><tr>\n <td>U+E796 \n </td><td>0xA6 0xF3 \n </td></tr><tr>\n <td>U+E81E \n </td><td>0xFE 0x59 \n </td></tr><tr>\n <td>U+E826 \n </td><td>0xFE 0x61 \n </td></tr><tr>\n <td>U+E82B \n </td><td>0xFE 0x66 \n </td></tr><tr>\n <td>U+E82C \n </td><td>0xFE 0x67 \n </td></tr><tr>\n <td>U+E832 \n </td><td>0xFE 0x6D \n </td></tr><tr>\n <td>U+E843 \n </td><td>0xFE 0x7E \n </td></tr><tr>\n <td>U+E854 \n </td><td>0xFE 0x90 \n </td></tr><tr>\n <td>U+E864 \n </td><td>0xFE 0xA0 \n </td></tr></tbody></table>" |
| 1261 | + }, |
1259 | 1262 | { |
1260 | 1263 | "html": "<p>Let <var>pointer</var> be the <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#index-pointer\" id=\"ref-for-index-pointer③\">index pointer</a> for <var>code point</var> in <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#index-gb18030\" id=\"ref-for-index-gb18030②\">index gb18030</a>. </p>" |
1261 | 1264 | }, |
|
1976 | 1979 | "rationale": "if", |
1977 | 1980 | "steps": [ |
1978 | 1981 | { |
1979 | | - "html": "<p>If <var>byte</var> is <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#end-of-stream\" id=\"ref-for-end-of-stream⑥①\">end-of-queue</a> and either <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-byte\" id=\"ref-for-utf-16-lead-byte\">UTF-16 lead byte</a> or <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate\">UTF-16 lead surrogate</a> is non-null, set <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-byte\" id=\"ref-for-utf-16-lead-byte①\">UTF-16 lead byte</a> and <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate①\">UTF-16 lead surrogate</a> to null, and return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#error\" id=\"ref-for-error⑤⑨\">error</a>. </p>" |
| 1982 | + "html": "<p>If <var>byte</var> is <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#end-of-stream\" id=\"ref-for-end-of-stream⑥①\">end-of-queue</a> and either <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-byte\" id=\"ref-for-utf-16-lead-byte\">UTF-16 lead byte</a> or <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate\">UTF-16 leading surrogate</a> is non-null, set <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-byte\" id=\"ref-for-utf-16-lead-byte①\">UTF-16 lead byte</a> and <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate①\">UTF-16 leading surrogate</a> to null, and return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#error\" id=\"ref-for-error⑤⑨\">error</a>. </p>" |
1980 | 1983 | }, |
1981 | 1984 | { |
1982 | | - "html": "<p>If <var>byte</var> is <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#end-of-stream\" id=\"ref-for-end-of-stream⑥②\">end-of-queue</a> and <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-byte\" id=\"ref-for-utf-16-lead-byte②\">UTF-16 lead byte</a> and <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate②\">UTF-16 lead surrogate</a> are null, return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#finished\" id=\"ref-for-finished②⑥\">finished</a>. </p>" |
| 1985 | + "html": "<p>If <var>byte</var> is <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#end-of-stream\" id=\"ref-for-end-of-stream⑥②\">end-of-queue</a> and <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-byte\" id=\"ref-for-utf-16-lead-byte②\">UTF-16 lead byte</a> and <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate②\">UTF-16 leading surrogate</a> are null, return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#finished\" id=\"ref-for-finished②⑥\">finished</a>. </p>" |
1983 | 1986 | }, |
1984 | 1987 | { |
1985 | 1988 | "html": "<p>If <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-byte\" id=\"ref-for-utf-16-lead-byte③\">UTF-16 lead byte</a> is null, set <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-byte\" id=\"ref-for-utf-16-lead-byte④\">UTF-16 lead byte</a> to <var>byte</var> and return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#continue\" id=\"ref-for-continue②①\">continue</a>. </p>" |
|
2004 | 2007 | ] |
2005 | 2008 | }, |
2006 | 2009 | { |
2007 | | - "html": "If <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate③\">UTF-16 lead surrogate</a> is non-null, let <var>lead surrogate</var> be <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate④\">UTF-16 lead surrogate</a>, set <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate⑤\">UTF-16 lead surrogate</a> to null, and then:", |
2008 | | - "rationale": "if", |
| 2010 | + "html": "If <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate③\">UTF-16 leading surrogate</a> is non-null:", |
| 2011 | + "rationale": "let", |
2009 | 2012 | "steps": [ |
2010 | 2013 | { |
2011 | | - "html": "<p>If <var>code unit</var> is in the range U+DC00 to U+DFFF, inclusive,\n return a code point whose value is\n 0x10000 + ((<var>lead surrogate</var> − 0xD800) << 10) + (<var>code unit</var> − 0xDC00). </p>" |
| 2014 | + "html": "<p>Let <var>leadingSurrogate</var> be <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate④\">UTF-16 leading surrogate</a>. </p>" |
| 2015 | + }, |
| 2016 | + { |
| 2017 | + "html": "<p>Set <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate⑤\">UTF-16 leading surrogate</a> to null. </p>" |
| 2018 | + }, |
| 2019 | + { |
| 2020 | + "html": "<p>If <var>code unit</var> is a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#trailing-surrogate\" id=\"ref-for-trailing-surrogate③\">trailing surrogate</a>, then return a <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#scalar-value-from-surrogates\" id=\"ref-for-scalar-value-from-surrogates①\">scalar value from surrogates</a> given <var>leadingSurrogate</var> and <var>code unit</var>. </p>" |
2012 | 2021 | }, |
2013 | 2022 | { |
2014 | 2023 | "html": "<p>Let <var>byte1</var> be <var>code unit</var> >> 8. </p>" |
|
2025 | 2034 | ] |
2026 | 2035 | }, |
2027 | 2036 | { |
2028 | | - "html": "<p>If <var>code unit</var> is in the range U+D800 to U+DBFF, inclusive, set <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate⑥\">UTF-16 lead surrogate</a> to <var>code unit</var> and return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#continue\" id=\"ref-for-continue②②\">continue</a>. </p>" |
| 2037 | + "html": "<p>If <var>code unit</var> is a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#leading-surrogate\" id=\"ref-for-leading-surrogate③\">leading surrogate</a>, then set <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#utf-16-lead-surrogate\" id=\"ref-for-utf-16-lead-surrogate⑥\">UTF-16 leading surrogate</a> to <var>code unit</var> and return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#continue\" id=\"ref-for-continue②②\">continue</a>. </p>" |
2029 | 2038 | }, |
2030 | 2039 | { |
2031 | | - "html": "<p>If <var>code unit</var> is in the range U+DC00 to U+DFFF, inclusive,\n return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#error\" id=\"ref-for-error⑥①\">error</a>. </p>" |
| 2040 | + "html": "<p>If <var>code unit</var> is a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#trailing-surrogate\" id=\"ref-for-trailing-surrogate④\">trailing surrogate</a>, then return <a data-link-type=\"dfn\" href=\"https://encoding.spec.whatwg.org/#error\" id=\"ref-for-error⑥①\">error</a>. </p>" |
2032 | 2041 | }, |
2033 | 2042 | { |
2034 | 2043 | "html": "<p>Return code point <var>code unit</var>. </p>" |
|
0 commit comments