Handle split surrogate pairs when encoding utf8 - by @yosion-p and @ashtuchkin in #282:
Handle a case where streaming utf8 encoder (converting js strings -> buffers) encounters surrogate pairs split between chunks (last character of one chunk is high surrogate and first character of the next chunk is a low surrogate).
Avoid false positives in encodingExists by using objects without a prototype - by @bjohansebas in #328
The encodingExists method could return incorrect results if the lookup matched properties inherited from the prototype of the object that stores the encodings, such as constructor and others. This change replaces that object with one that has no prototype, ensuring that only explicitly defined valid encodings in the library are considered. In addition, the fix is applied to the internal cache system to avoid the same kind of false positives
iconv.extendNodeEncodings()
mechanism. It was deprecated 5 years ago and didn't work
in recent Node versions.iconv.enableStreamingAPI(require('stream'))
.iconv.getEncoder()
and iconv.getDecoder()
methods to typescript definitions (#229).new Buffer
(#185, by @felixbuenemann)new Buffer()
usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR)extendNodeEncodings
extendNodeEncodings()
is called more than once