Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年1月.
TextDecoder() コンストラクターは、引数で指定されたエンコーディング用に新しく作成された TextDecoder オブジェクトを返します。
文字列で、既定値は "utf-8" です。 これは何れかの有効なラベルです。
options 省略可次のプロパティを持つオブジェクトです。
fatal論理値で、無効なデータをデコードした場合に TextDecoder.decode() メソッドが TypeError を発生させるかどうかを示します。 既定値では false であり、これはデコードする際に不正なデータを置換文字で置き換えることを意味します。
ignoreBOM論理値で、バイトオーダーマークを無視するか否かを示します。 既定値は false です。
label の値が未知の場合、または 'replacement' デコードアルゴリズムにつながる値のいずれか("iso-2022-cn" または "iso-2022-cn-ext")になっている場合に発生します。
| Encoding # ref-for-dom-textdecoder① |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年6月24日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.