Special characters in m-files do not carry over to published html
Show older comments
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!
Accepted Answer
More Answers (1)
Walter Roberson
on 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 ?
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!