Burmese Character as a string

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 Comments

@v k: what MATLAB version are you using?
2020a. Thank you for taking interest. I really need to print this character by any means.
What did you observe when you ran the test code I posted?

Sign in to comment.

 Accepted Answer

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
B103A = '်'
B1004
B1004 = 'င'
S1 = [B103A B1004] %this does not combine, so this is not the proper order
S1 = '်င'
S2 = [B1004 B103A] %this combines, so this is the proper order
S2 = 'င်'
%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 Comments

Really thank you for taking so much trouble.
I have a windows system. And it still does not show up, inside and outside of LiveScript.
The utility to run all fonts at once is extremely useful. I had downloaded all sorts of fonts for trying this out, and the total number of figures are 32. I am attaching a sample figure. All figures are the same - either empty boxes, or boxes with question marks in them.
Would it be too much trouble if I ask the same experimentation from your end for the character '1AB9' ? This is a dotted circle with a line in the third quadrant. The line makes an angle of 240 degrees (but the exact x=y angle of 225 degrees in the third quadrant will also be ok).
0x1AB9 is also empty boxes for all the installed fonts - after running your utility.
Both these characters, 103A, and 1AB9 are crucial.
Since these are just easy geometrical shapes - (1) 103A is a dotted circle with a solid semi-circle on top, and (2) 1AB9 is a dotted circle with an inclined line making an angle of 240 degrees - can there not be another way to achieve the same?
In your utility, how should the statement 'text( ...' be modified so that it uses uicontrol to write, instead of 'text' ?
I cannot seem to get 1AB9 to display.
I was not able to find any examples of it in use, and the various Unicode input web sites that I check, such as http://jkorpela.fi/fui.html8 do not display anything useful it on any combination that I test.
Ok.
I have one more bottleneck. If possible, it will be very helpful to have your input:
I just need 103A and 1AB9 as strings somehow though. Can it not be possible to use Matlab's integrated latex capabilities to achieve this?
I feel very uncomfortable asking for so much of your time. I am truly grateful.
In your utility, how should the statement 'text( ...' be modified so that it uses uicontrol to write, instead of 'text' ?
Here are two different representations in uicontrol. One of them uses just the characters as character codes; on releases up to R2014a this would certainly not render the unicode properly. The second of the ways uses HTML character entities in a uicontrol style listbox; this would be the approach needed up to R2014a (but those earlier releases would be unlikely to render the characters properly... but at least they would have a chance.)
This is for "tradition figures", not for the newer uifigure(); I do not have enough experience with uifigure() to put something like this together in the best way.
Note: using HTML coding for uicontrol will not work for uicontrol style text or style edit, but will work for listbox, popup, radiobox, and pushbutton.
B103A = char(0x103A);
B1004 = char(0x1004);
S2 = [B1004 B103A];
FL = setdiff(listfonts(), 'Symbol');
NF = length(FL);
for fidx = 1 : 15 : NF
tF = FL(fidx:min(NF,fidx+14));
fig = figure();
for K = 1 : length(tF)
fn = tF{K};
uicontrol('Position', [1 K*20 150 15], 'String', fn + " -> " + S2, 'fontname', fn, 'Parent', fig, 'Style', 'text');
end
fig = figure();
for K = 1 : length(tF)
fn = tF{K};
uicontrol('Position', [1 K*25 200 20], 'String', "<HTML>"+fn+" -> &#x1004;&#x103A;", 'fontname', fn, 'Parent', fig, 'Style', 'list');
end
end
64 (= 2 x 32) plots of empty boxes, and boxes with question marks and 'x' marks inside them ...
But how important is this utility. It eliminates the need to change the font everytime and try the new font. The byproduct of this question is itself of such immense value ...
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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!