I have several source files in a Visual Studio 2013 wep application project that I process using gulp
version 3.8.11. Those files are Unicode (UTF-8 with signature) - Codepage 65001
encoded text files. After process them, they appear as they were Windows 1252 encoded text files.
For example, given the following UTF-8 encoded
src/hello.html
file:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello</title>
</head>
<body>
<h1>Hello, my name is Jesús López</h1>
</body>
</html>
This is how it looks on the browser:
Using the following gulpfile.js
:
var gulp = require('gulp');
gulp.task('build', function () {
gulp.src('src/hello.html')
.pipe(gulp.dest('dist'));
});
After executing gulp build
on the command line, this is how it looks on the browser:
How can I solve this encoding problem? Please help.
gulp
source code and it doesn't seem possible with gulp 3 to pass in an encoding option togulp.src
. You will probably have some luck with some plugin. A quick google search will return many results. I am thinking you should raise this issue with the gulp developers. – Libertinagegulp-convert-encoding
with no luck. I raised an issue on gitub github.com/gulpjs/gulp/issues/1037. – Pearse