Why electron backend has different encoding and how to fix it?

Viewed 41

I'm trying to build an app in Electron and have a problem with some data processing because it doesn't properly encode the characters á,é,í,ó,ú,ñ ...


index.js

console.log('ñ - í - á - ó')

This works correctly when it's called by Node (node index.js) but when I execute the Electron app it prints:

ñ - í - á - ó


I discovered this while I was executing a function, but I've been making a few tests and found that the problem is in the Electron main file (the one that controls the Electron backend). I need to solve this issue to be able to handle the data and create files that don't have ├▒ in their names.

Searching in the Electron docs, I found that I'm able to change the browser encoding; but that is the frontend of the app, the console from the backend still shows the problem.

In case it's relevant: I'm using VSCode and it says that the file is encoded with utf-8, if I change this it prints other symbols but nothing that I recognize as letters.

0 Answers
Related