gulp-convert-encoding
Convert file encodings using iconv-lite.
npm install --save-dev gulp-convert-encoding
var gulp = require('gulp');
var convertEncoding = require('gulp-convert-encoding');
gulp.task('default', function () {
return gulp
.src('src/file.txt')
.pipe(convertEncoding({ to: 'iso-8859-15' }))
.pipe(gulp.dest('dist'));
});
One or both of the original and/or target file encodings must be specified.
Supported encodings are listed on the iconv-lite wiki.
Type: string
Default: utf8
The original file encoding.
Type: string
Default: utf8
The target file encoding.
Type: object
Default: { decode: {}, encode: {} }
Allows you to pass additional options into iconv-lite
, for example BOM Handling.