Encoding API
Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。
Encoding API はレガシーな非UTF-8エンコーディングを含む様々な文字エンコーディングのテキストを扱うメカニズムを提供します。
この API は 4 つのインターフェースを提供します。それは、 TextDecoder
、 TextEncoder
、 TextDecoderStream
(en-US) そして TextEncoderStream
(en-US) です。
インターフェース
チュートリアルとツール
- shimはこのインターフェースをサポートしていないブラウザでもこのインターフェスを使えるようにします。
StringView
は C 言語の文字列配列型のような表現を提供します。
仕様書
Specification |
---|
Encoding Standard # interface-textdecoder |
Encoding Standard # interface-textencoder |
Encoding Standard # interface-textencoderstream |
Encoding Standard # interface-textdecoderstream |
ブラウザーの対応
TextDecoder
BCD tables only load in the browser
TextEncoder
BCD tables only load in the browser