MATLAB improperly renders UTF-8 encoded character (chinese) when calling text()
3 views (last 30 days)
Show older comments
Hello,
I am trying to call text() to inscribe a UTF-8 encoded character (traditional chinese) into a figure. Before calling text(), I read the characters from a text file (with the proper UTF-8 encoding), using textscan(). I can verify that the characters are read correctly as I am able to view them in the workspace toolbar. However, the character is not properly displayed when calling text() in most cases. What usually happens is that I get a secondary box-like character that is displayed next to the correct character (see attached image). For some fonts, this does not happen, but for most it does. What is going on here?
What may be a hint is that when I print the character to the console I see a small dot before my character. Perhaps this small dot corresponds to the additional character that is rendered using text()? Oddly, I do not see this small dot when viewing the character in the workspace toolbar.
thanks
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/281465/image.png)
0 Comments
Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps 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!