フィルターのクリア

R2014a MATLAB Compiler (mcc) on Linux throws "Invalid character was detected."

4 ビュー (過去 30 日間)
RAB
RAB 2014 年 11 月 5 日
編集済み: Swarom Muley 2019 年 7 月 1 日
Just wanted to share the solution found as it took me ages as mcc does not provide any reference to which files cause the warning messages ...
(BTW - mcc on Windows runs just fine without these warnings.)
The cause is the presence of non UTF8 characters in m-code. MATLAB on Linux has UTF8 as default character set whilst MATLAB on Windows may have a different character set such as windows-1252.
Use
feature('DefaultCharacterSet')
to determine this.
Anyways - it can be a pain to identify the m-files that cause the warning. The linux shell command below helped me a lot:
find . -name *.m -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail
  1 件のコメント
Michael Steinbock
Michael Steinbock 2018 年 8 月 5 日
Thanks! I also found this useful for then identifying the parts of the files that had the issues:
grep -axv '.*' myFunction.m
Also, for the inexperienced (like me), RAB's code will create a file called utf8_fail that will contain a list of the offending .m files.

サインインしてコメントする。

回答 (1 件)

Swarom Muley
Swarom Muley 2019 年 7 月 1 日
編集済み: Swarom Muley 2019 年 7 月 1 日
New to Matlab

カテゴリ

Help Center および File ExchangeStandalone Applications についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by