gulp-community / gulp-concat

Streaming concat middleware for gulp
MIT License
792 stars 127 forks source link

Encoding problem on Windows #154

Open erredeco opened 3 years ago

erredeco commented 3 years ago

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 :(