Baseline Widely available
TextDecoder()
æé 彿°ä½¿ç¨åæ°ä¸æå®çç¼ç è¿åä¸ä¸ªæ°å建ç TextDecoder
对象ã
new TextDecoder()
new TextDecoder(utfLabel)
new TextDecoder(utfLabel, options)
åæ°
utfLabel
å¯é
ä¸ä¸ªå符串ï¼é»è®¤æ¯ "utf-8"
ãå¯ä»¥æ¯ä»»æææçç¼ç ã
options
å¯é
ä¸ä¸ªå ·æå±æ§ç对象ï¼
fatal
ä¸ä¸ªå¸å°å¼ï¼è¡¨ç¤ºå¨è§£ç æ ææ°æ®æ¶ï¼TextDecoder.decode()
æ¹æ³æ¯å¦å¿
é¡»æåº TypeError
ãé»è®¤æ¯ false
ï¼è¿æå³çè§£ç å¨å°ç¨æ¿æ¢åç¬¦æ¿æ¢éè¯¯çæ°æ®ã
RangeError
妿 label
弿¯æªç¥çï¼ææ¯ä½¿ç¨äº 'replacement'
è§£ç ç®æ³ï¼"iso-2022-cn"
æ "iso-2022-cn-ext"
两个å¼ä¹ä¸ï¼ï¼å伿åºã
const textDecoder1 = new TextDecoder("iso-8859-2");
const textDecoder2 = new TextDecoder();
const textDecoder3 = new TextDecoder("csiso2022kr", { fatal: true }); // Allows TypeError exception to be thrown.
const textDecoder4 = new TextDecoder("iso-2022-cn"); // Throw a RangeError exception.
è§è æµè§å¨å
¼å®¹æ§ åè§
TextDecoder
æ¥å£ãRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4