php – Problem with accent in .js after concat and ugliify in Gulp


I'm trying to optimize the website of the agency where I work and I'm having problems after concatenating and minifying the javascripts.

Our Apache server uses ISO-8859-1 and all my files in PHPStorm are configured in this same charset.

After doing concat and uglify in Gulp (which worked correctly), I had problems with accenting some system features, for example jQuery-ui's "DatePicker".

Where should be written "Time" is "Hor? River."

I've tried using " gulp-convert-encoding " and setting it to ISO-8859-1, but it didn't work either.

Here is the excerpt where I call the files, concatenation and minific:

var js  = [
    '../../../padroes/interface/scripts/shadowbox.js', // Padrão de interfaces

gulp.task('minify-js', function () {
        .pipe(convertEncoding({to: 'ISO-8859-1'}))
        .pipe(notify('Javascript compilado e minificado!'));

I saw that when I finished compiling, the script.min.js file is UTF-8 and all accented characters are replaced by (?).


if you use convertEncoding with from and to, all work fine:

     .pipe(convertEncoding({from: 'ISO-8859-15', to: 'UTF-8'}))
     .pipe(convertEncoding({from: 'UTF-8', to: 'ISO-8859-15'}))
Scroll to Top