Special characters in m-files do not carry over to published html
Ältere Kommentare anzeigen
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?
Thanks!
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 7 Jan. 2013
It appears to be doing a byte-by-byte publication. é is the byte sequence that would be used to encode é in UTF-8
char(unicode2native('é','utf-8'))
As an experiment, could you try saving a copy of the .m file as UTF-16 and publish from that ?
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!