|
|
|
@ -536,11 +536,11 @@ var csv = Papa.unparse({
@@ -536,11 +536,11 @@ var csv = Papa.unparse({
|
|
|
|
|
<code>decoder</code> |
|
|
|
|
</td> |
|
|
|
|
<td> |
|
|
|
|
A function which allows custom decoding for the buffer string. |
|
|
|
|
The function get Buffer and Encoding, and returns a string. |
|
|
|
|
A function which allows custom decoding of the chunk. |
|
|
|
|
The function get Chunk (Buffer/string) and Encoding, and returns a string. |
|
|
|
|
i.e assuming const iconv = require('iconv-lite'): |
|
|
|
|
(buf , encoding) => { |
|
|
|
|
if (iconv.encodingExists(encoding)) { return iconv.decode(buf, encoding) }; |
|
|
|
|
(chunk , encoding) => { |
|
|
|
|
if (iconv.encodingExists(encoding)) { return iconv.decode(chunk, encoding) }; |
|
|
|
|
throw new TypeError('[ERR_UNKNOWN_ENCODING]', 'Unknown encoding: ' + encoding) |
|
|
|
|
} |
|
|
|
|
</td> |
|
|
|
|