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 インターフェイスは、特定のテキストエンコーディング、例えば UTF-8、ISO-8859-2、KOI8-R、GBK などのデコーダーを表します。デコーダーは入力としてバイトストリームを受け取り、コードポイントのストリームを出力します。
メモ: この機能はウェブワーカー内で利用可能です。
新たに生成した TextDecoder を返します。これは、引数で指定したデコード方式を使用して連続したコードポイントを生成します。
TextDecoder インターフェイスは、何もプロパティを継承していません。
TextDecoder.encoding 読取専用デコーダーの名称を持つ文字列であり、これは TextDecoder が使用する方式を表す文字列です。
TextDecoder.fatal 読取専用エラーモードが fatal であるかを示す論理値です。
TextDecoder.ignoreBOM 読取専用バイトオーダーマークを無視するかどうかを示す論理値です。
TextDecoder インターフェイスは、何もメソッドを継承していません。
TextDecoder.decode()特定の TextDecoder オブジェクトの方式でデコードされたテキストを含む文字列を返します。
この例では、中国語/日本語の文字 を、異なる 5 種類の型付き配列、 Uint8Array, Int8Array, Uint16Array, Int16Array, Int32Array で表します。
この例では、ロシア語の "Привет, мир!"、 "Hello, world." という意味のテキストをデコードします。 TextDecoder() コンストラクターでは、キリル語の文字に適した Windows-1251 文字エンコーディングを指定します。
| Encoding # interface-textdecoder |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023年5月10日 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.