How can I save unicode characters in m-files and display them in figures using m-files?

3 ビュー (過去 30 日間)
Unicode characters (Hebrew letters, in my case) are not saved in m-files. After saving and re-opening the file I see blocks instead of the unicode characters. Also, when I try to display unicode characters in a figure, I get blocks; however, command line works fine and also displaying unicode characters that were read from a file. I tried to apply the solution given here, but this did not solve the problem and displayed garbage. Any solution?
  3 件のコメント
Ron Chen
Ron Chen 2020 年 5 月 10 日
Thanks Paul, I will install the latest version and give it a try
Walter Roberson
Walter Roberson 2020 年 10 月 11 日
R2020a does not need the lcdata_utf8 trick. It now stores .m files as utf-8 so code can contain them directly.
To display unicode inside a figure, the Interpreter for the text data must be 'none' or 'tex'; you cannot display arbitrary unicode characters when the Interpreter is 'latex'

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

採用された回答

Ron Chen
Ron Chen 2018 年 11 月 4 日
I managed to resolve this issue by renaming the file MATLABroot\bin\lcdata_utf8.xml to lcdata.xml.
  1 件のコメント
Andrey Kazak
Andrey Kazak 2019 年 5 月 13 日
The fix does not work on 2018b for Windows.
Please suggest a workaround.
Thank you.

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 11 月 1 日
By default, only the Korean, Japanese, and Chinese versions store source code in utf8 as is needed to store such characters directly in the file. For all other regions, you have to tweak MATLAB in a system dependant manner.
  3 件のコメント
Ron Chen
Ron Chen 2018 年 11 月 4 日
This is the same link I included in my original message, which did not work for me...

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

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by