gulp-convert-encoding
Convert character encodings using iconv-lite. Supports streams.
npm install --save-dev gulp-convert-encoding
import gulp from 'gulp';
import convertEncoding from 'gulp-convert-encoding';
export default () =>
gulp
.src('src/file.txt')
.pipe(convertEncoding({ from: 'iso-8859-1' }))
.pipe(gulp.dest('dist'));
Important
You must provide one or both of the from
and to
options.
Supported encodings are listed on the iconv-lite wiki.
Type: object
Type: string
Default: utf8
The current character encoding.
Type: string
Default: utf8
The target character encoding.
Type: object
Default: { decode: {}, encode: {} }
Allows you to pass additional options (e.g. for BOM Handling) into iconv-lite
.