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月.
TextEncoder はコードポイントのストリームを入力として受け取り、 UTF-8 のバイトストリームを出力します。
メモ: この機能はウェブワーカー内で利用可能です。
新たに生成した TextEncoder を返します。これは、 UTF-8 エンコーディングのバイトストリームを生成します。
TextEncoder インターフェイスは、何もプロパティを継承していません。
TextEncoder.prototype.encoding 読取専用常に utf-8 を返します。
TextEncoder インターフェイスは、何もメソッドを継承していません。
TextEncoder.encode()入力として文字列を取り、 UTF-8 でエンコードされたテキストを含む Uint8Array を返します。
TextEncoder.encodeInto()エンコードする文字列と、 UTF-8 でエンコードされたテキストが入る宛先の Uint8Array を取り、エンコーディングの進捗を示す辞書オブジェクトを返します。これは encode() よりも新しく、より性能が高くなる可能性があります。
| Encoding # interface-textencoder |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2026年4月12日 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.