Html-webpack-plugin: Encoding of index.html file in UTF-8

Created on 7 Nov 2016  路  5Comments  路  Source: jantimon/html-webpack-plugin

I am packaging an application using html-webpack-plugin. Everything is going fine but index.html is getting generated in ANSI format. This is causing the extra junk characters (like 脗) in my html page UI.
I resolved this issue using the help from below post:
_http://stackoverflow.com/a/11325511/1606668_

But I don't want to follow these steps manually. Is there anything in the parameter below template in below code?
new HtmlWebpackPlugin({
template: 'src/index.html'
});

I have tried using encoding: 'utf-8', but it is not working for me. Please let me know if anybody has any idea for this.

Most helpful comment

Let me check that. Thanks for your important input @jantimon :)

All 5 comments

Sorry only utf8 is supported by now - UTF8 has become the standard for web and it would be a lot of work to maintain other encondings.

@jantimon Yes, you are right. But my question is:
_Index.html file generated by html-webpack-plugin is in ANSI format by default. I want it to be generated in UTF-8 format with the configuration._

Well the file generation is done by webpack - not by this plugin.
It happens here:

https://github.com/ampedandwired/html-webpack-plugin/blob/master/index.js#L179-L185

Let me check that. Thanks for your important input @jantimon :)

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings