smart-encoding-convert
Inspired by buffer-encoding, but with clearer interface and minConfidence
support.
Install
npm install smart-encoding-convert
Usage
;; var buf = fs; var buf1 = ;var buf2 = ;var buf3 = ;
convert:Buffer
Options
minConfidence
: If jschardet detects a buffer with confidence less thanminConfidence
, the detected encoding would be overridden by themightFrom
options. Default is0.96
.mightFrom
: If the detected confidence is less thanminConfidence
, it will use this option as the incoming buffer's encoding. Default isutf-8
.to
: To which encoding the original buffer should convert. Default isutf-8
.from
: If present, there would be no auto-detect process and this option would be set as the incoming buffer's encoding. Default isundefined
.