gulp-concat icon indicating copy to clipboard operation
gulp-concat copied to clipboard

Encoding problem on Windows

Open erredeco opened this issue 4 years ago • 0 comments

Hi I have a concat task that concats a series of javascript file defined on an arrray CONFIG.JS_FILES defined like this:

'use strict';

var gulp = require('gulp');
var concat = require('gulp-concat');
var CONFIG = require('../config.js'); 
 
gulp.task('app-js', function() {
  return gulp.src(CONFIG.JS_FILES,{allowEmpty: true })
    .pipe(concat('app.js'))
    .pipe(gulp.dest(CONFIG.PATHS.destinationdir+'Assets/Js/'));
});

gulp.task('app--home-js', function() {
  return gulp.src(CONFIG.JS_HOME_FILES,{allowEmpty: true })
    .pipe(concat('app--home.js'))
    .pipe(gulp.dest(CONFIG.PATHS.destinationdir+'Assets/Js/'));
});


gulp.task('concat', gulp.series('app-js', 'app--home-js'));

The problem: some files in the array are picked up from the node_modules folder and are saved when installing them via npm i as ANSI Western European 1252 (Windows environment) while others are UTF-8 NO-BOM;

Thus the resulting file is saved as ANSI Western European 1252, so for example letters like "à" (224) become "Ã" (160)

I can't figure out how to solve this problem :(

erredeco avatar Mar 11 '21 11:03 erredeco