Skip to content

Encoding problem on Windows #154

@erredeco

Description

@erredeco

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions