Angular2 - How to code UTF-8 in components
I added <meta charset="UTF-8">index.html to the main file and correctly encodes special characters (for example, é, ç or à) that are entered inside this file, without using ascii encoding, for example é.
However, component templates seem to lose the encoding of special characters that are not entered in ascii.
I'm really not stuck as there is a workaround for ascii, but I'm curious about the logic that seems to prevent character encoding in component templates.
As Mark and Plunker note, the problem does not occur in the dev source directory.
A character encoding problem appeared when the "gulping" html files in the / dist directory.
, gulp -utf8-convert https://www.npmjs.com/package/gulp-utf8-convert
var gulp = require('gulp');
var utf8Convert = require('gulp-utf8-convert');
gulp.task('copy-html', function() {
return gulp.src('src/**/*.html')
.pipe(utf8Convert())
.pipe(gulp.dest('www'));
});