Burmese Character as a string
3 次查看(过去 30 天)
显示 更早的评论
Hello, I am trying to obtain the string representation of the burmese character given by the unicode number U+103A. But it does not print out, and only gives a box in the figure and the command window, even after using UTF8 as the character set. This unicode number is the exact figure of dotted circle with a solid semi-circle on top of the dotted circle.
How can I save this character as a string? Thanks.
p.s. - I am using other unicodes (in the same dot-m file) which require utf8 as the default character encoding. These ones require a non-English language, which is also the one set in the system Language Preferences. But this is not the Burmese language.
် this is the character.
3 个评论
采纳的回答
Walter Roberson
2020-11-9
编辑:Walter Roberson
2020-11-9
So I did some testing... but you will need to do the same tests on your own system to see how it goes.
The characters show up as combined (when the combining character is put after the base character) on the command window when LiveScript is used.
The characters do not show up as other than boxes in the test I did here online, on the experimental facility to display results for you, but when I test on my Mac, the characters show up separately for all fonts except a few of the Lucida fonts (and then they show up as boxes.) I was not able to get the characters to combine on a plot... except by drawing multiple characters at the same position (but then they will not combine properly as the dotted circle will show up, which should not happen when a real combination is done.)
Please test this code on your own system, inside of and outside of Live Script.
B103A = char(0x103A);
B1004 = char(0x1004);
B103A
B1004
S1 = [B103A B1004] %this does not combine, so this is not the proper order
S2 = [B1004 B103A] %this combines, so this is the proper order
%When I use Livescript, S2 displays in combined form to the command window
%But when I use Mac command window, S2 displays separately.
%I do not have a Windows system handy
%now try plotting with all kinds of fonts
%sorry for all the figures, but this system only displays up to about Ylim 16
FL = setdiff(listfonts(), 'Symbol');
NF = length(FL);
for fidx = 1 : 15 : NF
tF = FL(fidx:min(NF,fidx+14));
fig = figure();
ax = axes('Parent', fig);
for K = 1 : length(tF);
fn = tF{K};
text(1, K, fn + " -> " + S2, 'fontname', fn, 'interpreter', 'tex');
end;
xlim([0 75]); ylim([0 16]);
end
6 个评论
Walter Roberson
2020-11-11
It is disappointing that the controls never seem to render the characters properly at all, and that text() is not able to render the combining codes properly.
The one positive result of this is that it shows that if you are getting just plain emptiness instead of the characters, that changing the font can help to at least get a placeholder.
Note: the 15 fonts per plot was chosen to fit in to the experimental facility I am using to show the results online, which unfortunately does not display large plots without clipping.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!