Search code examples
matlabuser-interfacenon-ascii-characters

French accents in MATLAB gui


I'm working on a MATLAB program with a gui. I want to have text labels and buttons in french, but it doesn't work. For example, the word 'Paramètres' in the code becomes Paramètres on the gui.

I checked the file encoding and it's utf-8. What can I do to fix that?

Here's a simple example of one command that I used in the code: tab2 = uitab('v0', hTabGroup, 'title','Paramètres des canaux');

Thanks.


Solution

  • I found the answer on this stackoverflow page. Basically, I just have to set MATLABencoding to UTF-8 before creating the GUI. The command is simply:

    feature('DefaultCharacterSet','UTF-8');
    

    and that's it!