Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grammar fix in TextDecoder #24348

Merged
merged 4 commits into from Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions files/en-us/web/api/textdecoder/decode/index.md
Expand Up @@ -28,13 +28,13 @@ decode(buffer, options)
### Parameters

- `buffer` {{Optional_Inline}}
- : Is an [`ArrayBuffer`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), a {{jsxref("TypedArray")}} or a {{jsxref("DataView")}} object containing the encoded text to decode.
- : An [`ArrayBuffer`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), a {{jsxref("TypedArray")}}, or a {{jsxref("DataView")}} object containing the encoded text to decode.
- `options` {{Optional_Inline}}

- : An object with the property:

- `stream`
- : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`.
- : A boolean flag indicating whether additional data will follow in subsequent calls to `decode()`.
Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked.
It defaults to `false`.

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/textdecoder/encoding/index.md
Expand Up @@ -53,23 +53,23 @@ A lower-cased ASCII string, which can be one of the following values:
['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding).
- The legacy multi-byte Chinese (simplified) encodings:
['gbk'](https://en.wikipedia.org/wiki/GBK),
['gb18030'](https://en.wikipedia.org/wiki/GB_18030)
['gb18030'](https://en.wikipedia.org/wiki/GB_18030).
- The legacy multi-byte Chinese (traditional) encoding:
['big5'](https://en.wikipedia.org/wiki/Big5).
- The legacy multi-byte Japanese encodings:
['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP),
['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP),
['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS).
- The legacy multi-byte Korean encodings:
['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR)
['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR).
- The legacy miscellaneous encodings:
['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes),
['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes),
`'x-user-defined'`.
- A special encoding, `'replacement'`.
This decodes empty input into empty output and any other arbitrary-length input into a single replacement character.
It is used to prevent attacks that mismatch encodings between the client and server.
The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](<https://en.wikipedia.org/wiki/HZ_(character_encoding)>).
The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR), and ['hz-gb-2312'](<https://en.wikipedia.org/wiki/HZ_(character_encoding)>).

## Specifications

Expand Down
8 changes: 4 additions & 4 deletions files/en-us/web/api/textdecoder/fatal/index.md
Expand Up @@ -15,14 +15,14 @@ browser-compat: api.TextDecoder.fatal

The **`fatal`** read-only property of the {{domxref("TextDecoder")}} interface is a {{jsxref('Boolean')}} indicating whether the error mode is fatal.

If the property is `true` then a decoder will throw a {{jsxref("TypeError")}} if it encounters malformed data while decoding.
If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�).
If the property is `true`, then a decoder will throw a {{jsxref("TypeError")}} if it encounters malformed data while decoding.
If `false`, the decoder will substitute the invalid data with the replacement character `U+FFFD` (�).
The value of the property is set in the [`TextDecoder()` constructor](/en-US/docs/Web/API/TextDecoder/TextDecoder).

## Value

A {{jsxref("boolean")}} which will return `true` if the error mode is set to `fatal`.
Otherwise it returns `false`, indicating that the error mode is "replacement".
A {{jsxref("Boolean")}} which will be `true` if the error mode is set to `fatal`.
sideshowbarker marked this conversation as resolved.
Show resolved Hide resolved
Otherwise, it will be `false`, indicating that the error mode is `replacement`.

## Specifications

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/textdecoder/ignorebom/index.md
Expand Up @@ -17,7 +17,7 @@ The **`ignoreBOM`** read-only property of the {{domxref("TextDecoder")}} interfa

## Value

`true` if the byte order mark is ignored; `false` otherwise.
`true` if the [byte order mark]((https://www.w3.org/International/questions/qa-byte-order-mark)) is ignored; `false` otherwise.

## Specifications

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/textdecoder/index.md
Expand Up @@ -28,7 +28,7 @@ The **`TextDecoder`** interface represents a decoder for a specific text encodin
_The `TextDecoder` interface doesn't inherit any properties._

- {{DOMxRef("TextDecoder.encoding")}} {{ReadOnlyInline}}
- : A string containing the name of the decoder, that is a string describing the method the `TextDecoder` will use.
- : A string containing the name of the decoder, which is a string describing the method the `TextDecoder` will use.
- {{DOMxRef("TextDecoder.fatal")}} {{ReadOnlyInline}}
- : A {{jsxref('Boolean')}} indicating whether the error mode is fatal.
- {{DOMxRef("TextDecoder.ignoreBOM")}} {{ReadOnlyInline}}
Expand Down Expand Up @@ -86,5 +86,5 @@ console.log(win1251decoder.decode(bytes)); // Привет, мир!
## See also

- The {{DOMxRef("TextEncoder")}} interface describing the inverse operation.
- A [shim](https://github.com/inexorabletash/text-encoding) allowing to use this interface in browsers that don't support it.
- A [shim](https://github.com/inexorabletash/text-encoding) allowing to use this interface in browsers that do not support it.
- [Node.js supports global export from v11.0.0](https://nodejs.org/api/util.html#util_class_util_textdecoder)