2

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.

snwflk
  • 3,341
  • 4
  • 25
  • 37
Jack
  • 21
  • 3
  • That is unusual, and you'll probably need to provide a minimal app reproducing the problem before anyone can help. Alternatively, clone the https://github.com/electron/electron-quick-start app and see if you can reproduce it there, and if not, keep adding your code to that app until you discover what is triggering it. BTW, what OS are you running it on? – Darren Cook Aug 14 '22 at 07:39
  • I installed the github.com/electron/electron-quick-start app as you said, added a "console.log('ñ')" to the main page and got the same response, ├▒ instead of the ñ. So I guess it's a local issue ? I'm using windows 10 – Jack Aug 15 '22 at 15:40
  • Aha, by searching for that `├` character, I managed to find https://stackoverflow.com/q/64740653/841830 If those instructions work it might be simplest to then close this question as a duplicate of that one. – Darren Cook Aug 15 '22 at 16:55
  • Thanks a lot! it's working correctly. I'm ashamed for not found those answers by myself. I already tag the question as duplicated but I think I'm unable to close it (or at least I don't know how to do it). Again, thank you – Jack Aug 15 '22 at 19:10

0 Answers0