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.decode() メソッドは、引数として渡されたバッファーからデコードしたテキストを含む文字列を返します。
デコードするメソッドは、現在の TextDecoder オブジェクトで定義されます。 これには、データの予想されるエンコードや、デコードエラーの処理方法などが含まれます。
デコードするエンコードされたテキストが入っている、ArrayBuffer、TypedArray、DataView の何れかのオブジェクトです。
options 省略可以下のプロパティを持つオブジェクトです。
stream論理値のフラグで、以後 decode() を呼び出す際に、追加データが続くかどうかを示します。 データを塊で処理する場合は true に設定し、最後の塊、またはデータが塊でない場合は false に設定します。 既定値は false です。
TextDecoder.fatal プロパティが true の場合、デコードエラーがあると発生します。
文字列です。
この例では、ユーロ記号 € をエンコードし、デコードしています。
| Encoding # ref-for-dom-textdecoder-decode① |
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.