File Exchange: Why are some characters, such as "²", omitted in the code shown in the "Functions" tab of a file?

조회 수: 2 (최근 30일)
When accessing the "Functions" tab of a file in File Exchange, the code of the uploaded functions is shown. I have discovered that this code is not necessarily the actual code that was uploaded: Some characters are simply missing, such as "°" and "²". In one of my functions, this leads to faulty figure titles and documentation. Is this intended to happen?
In my experience, many people do not use the Download button to access files from File Exchange but instead simply copy and paste the code from the website via the Functions tab, either because they do not have a MathWorks account or because they are too lazy to log in. Hence I think that the code that can be copied from the website should be exactly the same as in the actual file.
Is there a list of to-be-omitted characters, or a rule that determines whether characters are omitted? Are all superscripts omitted? If this issue persists, I would like to know which characters I should avoid to use.

채택된 답변

Stephen23
Stephen23 2018년 5월 23일
편집: Stephen23 2018년 5월 23일
"I would like to know which characters I should avoid to use."
If you want to write truly universal files that work for everyone, and can be stored, represented, copy-and-pasted, downloaded, etc., then avoid anything that is not ASCII:
This is the only way to guarantee a universal file, where all characters will be correctly stored and displayed, regardless of the users' settings. Yes, even on modern computers: all of the UTF encodings and various other encoding are very pretty, but if you want code that works stick to ASCII.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by