SeanSobey / ChartjsNodeCanvas

A node renderer for Chart.js using canvas.
MIT License
230 stars 79 forks source link

UTF-8 Character Encoding Issue #139

Open MartinHatchUK opened 1 year ago

MartinHatchUK commented 1 year ago

We are using ChartJS Node Canvas to create charts saved to image files to be served from a Discord bot.

One issue we are currently facing is that character encoding appears messed up.

The data (when debugging and stepping through the code) is absolutely fine and the names in text all appear correctly - but when the Chart renders the values they come up with the UTF-8 characters replaced with something else.

image

I also note that this example the UTF-8 character is a "Unicode Character 'KATAKANA MIDDLE DOT' (U+30FB)" And I can see the icon is "30| FB"

We are running this on a NodeJS 20.8 image and using "chartjs-node-canvas": "^4.1.6",