A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/ja/docs/Web/API/TextDecoder/TextDecoder below:

TextDecoder: TextDecoder() コンストラクター - Web API

TextDecoder: TextDecoder() コンストラクター

Baseline Widely available

TextDecoder() コンストラクターは、引数で指定されたエンコーディング用に新しく作成された TextDecoder オブジェクトを返します。

構文
new TextDecoder()
new TextDecoder(label)
new TextDecoder(label, options)
引数
label 省略可

文字列で、既定値は "utf-8" です。 これは何れかの有効なラベルです。

options 省略可

次のプロパティを持つオブジェクトです。

fatal

論理値で、無効なデータをデコードした場合に TextDecoder.decode() メソッドが TypeError を発生させるかどうかを示します。 既定値では false であり、これはデコードする際に不正なデータを置換文字で置き換えることを意味します。

ignoreBOM

論理値で、バイトオーダーマークを無視するか否かを示します。 既定値は false です。

例外
RangeError

label の値が未知の場合、または 'replacement' デコードアルゴリズムにつながる値のいずれか("iso-2022-cn" または "iso-2022-cn-ext")になっている場合に発生します。

例
const textDecoder1 = new TextDecoder("iso-8859-2");
const textDecoder2 = new TextDecoder();
const textDecoder3 = new TextDecoder("csiso2022kr", { fatal: true }); // TypeError 例外を発生できるようにします。
const textDecoder4 = new TextDecoder("iso-2022-cn"); // RangeError 例外が発生します。
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4