I `publish()` quite a bit of m-files to html format for teaching purposes. I (and the students) like to write comments, titles, etc., in French with accentuated letters. I save my m-file with utf-8 encoding. Matlab's `publish` generates a html file with utf-8 character encoding as well but somewhere in the process, accentuated characters have been transformed to rubbish.
For example, the character "é" is transformed to a hard-coded "Ã©" in the html output, which is displayed as "Ã©".
Are there options somewhere to preserve accentuated characters in comments?
No products are associated with this question.
Thanks for the quick reply. I tried 4 variants of UTF-16 and they did not work (either causing Matlab to complain about unrecognized characters or ignoring entire chunks of the file.) On the other hand, other encodings such as Western ISO-8859-15 work. Mac Roman doesn't work (I'm using OSX.)
I guess we'll just have to make an exception for m-files and save them using ISO-8859-15.
It appears to be doing a byte-by-byte publication. Ã© is the byte sequence that would be used to encode é in UTF-8
As an experiment, could you try saving a copy of the .m file as UTF-16 and publish from that ?