-
Notifications
You must be signed in to change notification settings - Fork 16
/
iconv-lite.node.txt
46 lines (32 loc) · 2.89 KB
/
iconv-lite.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ICONV-LITE
ALTERNATIVES ==> # - TextDecoder|TextEncoder (preferred): full set of encodings requires full ICU data (see Node.js doc)
# - iconv-lite
# - node-iconv: more charsets, but much slower
VERSION ==> #0.6.3
'ENCODING' #Lots of encodings are supported:
# - including utf8, utf16[-le|be], utf32[-le|be], ascii, binary, base64, hex
# - many others (see online doc)
ICONVLITE.decode #ENCODING to utf-8
(BUFFER|ARRBUFFER|UINT8ARR, #OPTS:
'ENCODING'[, OPTS])->STR # - stripBOM BOOL (def: true)
ICONVLITE.encode #utf-8 to ENCODING
(STR, 'ENCODING'[, OPTS])->BUFFER#OPTS:
# - addBOM BOOL (def: false)
ICONVLITE.decode|encodeStream
('ENCODING'[, OPTS])->IOSTREAM #Same as decode|encode() but as IOSTREAM
ICONVLITE.encodingExists
('ENCODING')->BOOL #
/=+===============================+=\
/ : : \
)==: FETCH-CHARSET-DETECTION :==(
\ :_______________________________: /
\=+===============================+=/
FETCH-CHARSET-DETECTION ##Guesses charset from:
(STABUFFER[, HEADERS])->STR ## - Content-Type [C|S] (in HEADERS)
## - HEADERS is DOM's (can use node-fetch in Node.js)
## - '<meta charset>' in HTML
## - def: 'utf-8'
##Then uses ICONVLITE.decode()
##Version 1.0.1