I'm trying to optimize the website of the organ where I work and I'm having problems after concatenating and minifying the javascripts.
Our Apache server uses ISO-8859-1 and all of my files in PHPStorm are configured on the same charset.
After doing the concat and uglify in Gulp (which worked correctly), I had problems with accentuation in some system functionalities, for example the "DatePicker" of jQuery-ui.
Where should be typed " Schedule " is " Schedule ".
I've tried using " gulp-convert-encoding " and set it to ISO-8859-1, but it also did not work.
The section where I call the files, the concatenation and minifico follows:
var js = [
'./msg/js/jquery-1.10.1.min.js',
'./placeholder/jquery-placeholder.js',
'./msg/js/msg.js',
'./enviarArquivo/js/ajaxupload.3.5.js',
'./funcoes/funcoes.js',
'../../../padroes/interface/scripts/shadowbox.js', // Padrão de interfaces
'./calendario/jquery-ui-1.10.3.custom.js',
'./calendario/jquery-ui-timepicker-addon.js',
'./combobox/chosen.jquery.js',
];
gulp.task('minify-js', function () {
gulp.src(js)
.pipe(concat('script.min.js'))
.pipe(convertEncoding({to: 'ISO-8859-1'}))
.pipe(uglify())
.pipe(gulp.dest('../pages/template/js/dist/'))
.pipe(notify('Javascript compilado e minificado!'));
});
I saw that when I finished compiling, the script.min.js file is left as UTF-8 and all accented characters are replaced with (?).