utf 8 - MATLAB and Character Encoding: How to run/edit an ISO8859-1 m-file in a UTF-8 system? -
i have large application written in matlab strings , comments using iso8859-1. run , update application in utf-8 matlab environment (matlab 2012a under linux). possible? editor shows little squares non-ascii characters , string comparisons don't seem work.
he quick solution:
it looks there no foolproof way of dealing non-native encoding within matlab itself. imagined forcing encoding change inside application no avail. instead, changed locale command line before starting matlab. like
export lc_ctype="en_us.iso-8859-1"; matlab;
you might convert file encoding using external program. see e.g. https://askubuntu.com/questions/41643/how-to-convert-multiple-iso8859-1-to-utf-8. problem have convert encoding if want run them on older windows matlab versions.
if don't want convert files, try using undocumented command feature('defaultcharacterset', 'iso8859-1') @ matlab prompt. never used don't know if work you, it's worth try.
Comments
Post a Comment