Why does Octave insert this strange character on my file?

Viewed 139

I was creating the code bellow in Octave and I got some strange behaviour:

# Sou um lab feliz
# Jesus, nosso Senhor, te ama
S1 = single(1.0);
S2 = single(0.0);
k = 1;
while(true)
...

And it was looking fine for me. But when I ran the code I got this:

  parse error near line 1 of file 
  /home/gabriel/Documentos/Tarefas/Universidade/MS211/lab01.m
  syntax error
  ~}# Sou um lab feliz
   ^

These characters were not on my editor. When I opened it at VS Code they were actually there, I deleted them and everything worked fine. But when I used the Octave editor and saved the file, the same happened, every time, even in different files this happens. Why is this happening?

1 Answers

Me and some friends, we found the problem.

For some reason I don't know, the Octave was configured to save in the HZ-GB-2312 encoding, I think that's why it was saving wrong my file, when turned to UTF-8 it started to work well, as it would be working.

Related