Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React + Webpack character encoding issues

I'm currently making a website using ReactJS and webpack to build it.

My text editor is set on ISO-8859-15 encoding and I'm using accented or special chars like é è à ç.

In my html page, I believe I'm using the right configuration:

<meta charset="iso-8859-15">

But special chars are not rendered the right way: Fran�ais instead of Français for instance.

I tried to set charset="utf-8" but nothing changed.

I feel like webpack is building with UTF-8 encoding, which brakes my chars. How could I fix this issue?

like image 870
pistou Avatar asked Feb 03 '16 16:02

pistou


1 Answers

I didn't find a way to make webpack read input files with an encoding other than UTF-8. I had to set up my project to write source files in UTF-8, and then used webpack-encoding-plugin to output files as ISO-8859-1 or whatever. It worked.

like image 197
Sérgio Siegrist Avatar answered Nov 10 '22 17:11

Sérgio Siegrist