Char not working properly ?
显示 更早的评论
Hello
char(8337)
but on my machine it doesn't work. 

Other unicode work but not this one. Does anybody know what I should check ?
I'm on window 11 and my laptop is in french if that helps.
7 个评论
Dyuman Joshi
2023-1-6
I think that is how the symbol appears in the command window.
Though, if you see it in workspace, you will find that the symbol is correct. I've attached an image for reference.
Adam Danz
2023-1-6
@Matteo Bonhomme, how do you plan on using ths character? Is the purpose to only display in the command window or should it display elsewhere such as a graphics text object?
Matteo Bonhomme
2023-1-9
Dyuman Joshi
2023-1-9
Maybe changing the font is causing the issue. Can you try again without the font changes?
Matteo Bonhomme
2023-1-9
I was able to reproduce these difference between results shown here and on my local machine. Clearly the encoding is not consistent between the Run feature and my local installation and there are differences between recent releases. There were changes to system encoding in 22a (release notes) but that does not explain these differences and I haven't had time to look deeper.
unidec = hex2dec({'2090','2099','209c','2091','2099','2099','2090'})
str = ['T', char(unidec')]
text(0.5,0.5,str,'FontSize',24)
采纳的回答
更多回答(1 个)
To display in a figure is straightforward, e.g.:
figure; title(char(8337))
text(0.5, 0.5, ['This is the character: ' char(8337)])
3 个评论
Matteo Bonhomme
2023-1-9
Rik
2023-1-9
The whole point of Unicode is not to have these things happen, so this behavior should be considered a bug. Please report it.
Matteo Bonhomme
2023-1-9
类别
在 帮助中心 和 File Exchange 中查找有关 Graphics Object Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






