Error in rendering special character

27 visualizzazioni (ultimi 30 giorni)
Gab D
Gab D il 25 Gen 2024
Commentato: Gab D il 12 Feb 2024
I often have to write in french, either to define strings for folder location or for comments.
My problem is that, since updating to matlab R2023b, I get errors simbols "�" in place of special characters (é, è, à, ...) each time I boot matlab and open a script (see figure below). This only happens on matlab that I reach on a server through Remote Desktop, and not on my personal computer (which has the same version). So, I believe it's something about how matlab has been installed or a setting that I cannot find. The errors are present in both .mlx and .m files.
I have tried made sure that the version installed is indeed 64 bit with the commands:
computer; computer('arch');
and receive 'PCWIN64' and 'win64'.
Finally, I wish I could just "not" write in french and only in english to solve this problem, but it is currently not possible.
  4 Commenti
Star Strider
Star Strider il 25 Gen 2024
My pleasure!
I do not have that problem, however I am interested in learning the solution.
Jon Asier Bárcena Petisco
I have a similar problem. I used Matlab on my courses because the life script was visually really nice, but using English is simply not an option (I'm Spanish).

Accedi per commentare.

Risposta accettata

Pavan Sahith
Pavan Sahith il 7 Feb 2024
Hello Gab,
I see that your MATLAB is not identifying French characters correctly and question marks are appearing instead, it could be due to the incorrect encoding being used. To get a better understanding of the current locale settings in MATLAB, you can use the command:
feature('locale')
Generally ,setting the encoding to 'UTF-8' should solve this issue. For that you can try the following steps:
  • In MATLAB, Use "Save As" to save the file.
  • The saving box that comes up will have a menu that allows you to select the format of the file to save as.
  • Make sure that UTF-8 is selected and not "all .m files".
Additionally, I've found a couple of MATLAB Answers posts that might help you in setting the encoding to 'UTF-8'.
If the issue still persists, you can contact the Technical Support.
Hope this helps!
  1 Commento
Gab D
Gab D il 12 Feb 2024
Hello,
I was communicating with Matlab's support at the same time, as suggested by @Star Strider. There was indeed a problem with the encoding and changing it to UTF-8 solved the wrongly appearing characters.
Using the line you suggested:
feature('locale')
I noticed that before the encoding was "windows-1252".
I used the informations on the following link and was able to change to UTF-8.
I accepted your answer.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by