gulpjs / gulp

A toolkit to automate & enhance your workflow
https://gulpjs.com
MIT License
33.01k stars 4.23k forks source link

Copy changes UTF8 text file encoding to ASCII on Windows #1546

Closed bbaia closed 8 years ago

bbaia commented 8 years ago

Hi,

A gulp copy of a robots.txt file, changes the encoding from UTF8 to ASCII.

return gulp.src(['robots.txt'])
           .pipe(gulp.dest('build'));

Is this a bug or an expected behavior ?

TIA, Bruno

phated commented 8 years ago

I'm pretty sure we are writing files with utf8 encoding. What version of gulp, etc are you using?

bbaia commented 8 years ago

gulp v3.9.1 node v4.3.1

phated commented 8 years ago

Can you try this in gulp 4?

phated commented 8 years ago

I'm pretty sure we aren't writing these files as ASCII. How did you determine this?

roselan commented 8 years ago

I believe i have this issue too when trying to build icons for https://github.com/swisnl/jQuery-contextMenu.

By example, "delete" icon character becomes "EE A8 84" instead of "EE AA BC".

roselan commented 8 years ago

Actually, it was linked to https://github.com/nfroidure/gulp-iconfont/issues/64 . sorry sorry!

phated commented 8 years ago

@roselan alright, glad you figured it out

@bbaia I'm going to close due to inactivity. I have no idea how to follow up on this without more information.

ftanrisevdi commented 8 years ago

@bbaia i had the same issue but i upgrade my node and gulp. It is ok now.

gulp.task('copy', function () {
    return gulp.src(['Scripts/app/**/*.html'])
      .pipe(gulp.dest('./dist/js'));
});
patrickbussmann commented 7 years ago

@ftanrisevdi and @phated: I tried with node 6.11.3 and gulp 4.0.0-alpha2 and it not work. The files which are written in UTF-8-BOM will be System (ASCII) afterwards.

I also tried the https://www.npmjs.com/package/gulp-convert-encoding plugin which not works, too.

.pipe(convertEncoding({to: 'utf8'}))

And the https://www.npmjs.com/package/gulp-charset plugin.

.pipe(charset({to: 'UTF-8'}))

But nothing works 😭

phated commented 7 years ago

@patrickbussmann commenting on long-closed issues doesn't help you. Please create a properly structured issue detailing your problem fully so I can give an appropriate answer.