<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Another couple of Matlab bugs and workarounds	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=couple-of-matlab-bugs-and-workarounds</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Tue, 09 Apr 2019 14:25:16 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-473820</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 09 Apr 2019 14:25:16 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-473820</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-473814&quot;&gt;GGa&lt;/a&gt;.

Typo corrected, meant ASCII of course (ASCII is represented by 1 byte in UTF-8, and 2 bytes in UTF-16)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-473814">GGa</a>.</p>
<p>Typo corrected, meant ASCII of course (ASCII is represented by 1 byte in UTF-8, and 2 bytes in UTF-16)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: GGa		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-473814</link>

		<dc:creator><![CDATA[GGa]]></dc:creator>
		<pubDate>Tue, 09 Apr 2019 13:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-473814</guid>

					<description><![CDATA[There isn&#039;t anything &quot;outside the UTF-8 range&quot;.
UTF-8 can represent any Unicode character, as far as I know.]]></description>
			<content:encoded><![CDATA[<p>There isn&#8217;t anything &#8220;outside the UTF-8 range&#8221;.<br />
UTF-8 can represent any Unicode character, as far as I know.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Unicode paths with MATLAB - HTML CODE		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-367188</link>

		<dc:creator><![CDATA[Unicode paths with MATLAB - HTML CODE]]></dc:creator>
		<pubDate>Mon, 11 Jan 2016 11:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-367188</guid>

					<description><![CDATA[[&#8230;] useful info on how matlab handles filenames (and characters in general) available in comments of this undocumentedmatlab post (especially steve eddins, works @ mathworks). in [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] useful info on how matlab handles filenames (and characters in general) available in comments of this undocumentedmatlab post (especially steve eddins, works @ mathworks). in [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ed Yu		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-341444</link>

		<dc:creator><![CDATA[Ed Yu]]></dc:creator>
		<pubDate>Mon, 15 Dec 2014 20:53:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-341444</guid>

					<description><![CDATA[Hi all,

I&#039;ve recently came across a MATLAB bug that completely blew my mind (for over a year)... Imagine you have an MCR application that executes for the first time, fails the second time (some windows DLL error), works the third time, fails the forth time, so on so forth...

Talked to MATLAB support and they guided us to run tests and gather information, the standard stuff that you do to try and find out what&#039;s wrong. This bug is especially difficult to figure out because the application runs fine with the majority of our clients and we cannot duplicate the issue in house... The clients that ran fine are US clients (hint, hint...) the clients that had the problem are all from outside US (hint, hint...). Imagine we have to coordinate with our clients to perform the information gathering across timezones (we are US Mountain time) and our clients having the issue are from England, Denmark, etc...

So one night as I sit watching TV late at night, a light bulb suddenly lit up... It has something to do with Locale settings (actually it has to do with the default character set) within MATLAB... Our development machines are all running Windows US locale, the machine that produces the MCR executable is also a US locale machine. So after some quick checking setting Windows to non-US locale and running our US locale compiled MCR app, we finally reproduced the error. Subsequently, talking to MathWorks and they admit that it is a known bug and has to do with running a compiled MCR application on another computer with a different locale cause an error message to be displayed in the DOS command window if the MCR application is compiled as a DOS application and we can see the error message. But if the app is compiled as a Windows application (no DOS window while the app is running), the output error message causes MCR to crash...

The workaround is to compile our application as a traditional app with a DOS command window, or alternatively patch our MATLAB R2013b (MCR) or upgrade to MATLAB R2014a (where the bug is fixed).

So the lesson of this story is that it is really unfortunate that MathWorks is not sharing bug reports which can cause a lot of grief for MATLAB programmers...

Lastly, thank you Amro for sharing how to change the default character sets within MATLAB which actually might help us to avoid this bug if you had posted this a couple of weeks earlier...]]></description>
			<content:encoded><![CDATA[<p>Hi all,</p>
<p>I&#8217;ve recently came across a MATLAB bug that completely blew my mind (for over a year)&#8230; Imagine you have an MCR application that executes for the first time, fails the second time (some windows DLL error), works the third time, fails the forth time, so on so forth&#8230;</p>
<p>Talked to MATLAB support and they guided us to run tests and gather information, the standard stuff that you do to try and find out what&#8217;s wrong. This bug is especially difficult to figure out because the application runs fine with the majority of our clients and we cannot duplicate the issue in house&#8230; The clients that ran fine are US clients (hint, hint&#8230;) the clients that had the problem are all from outside US (hint, hint&#8230;). Imagine we have to coordinate with our clients to perform the information gathering across timezones (we are US Mountain time) and our clients having the issue are from England, Denmark, etc&#8230;</p>
<p>So one night as I sit watching TV late at night, a light bulb suddenly lit up&#8230; It has something to do with Locale settings (actually it has to do with the default character set) within MATLAB&#8230; Our development machines are all running Windows US locale, the machine that produces the MCR executable is also a US locale machine. So after some quick checking setting Windows to non-US locale and running our US locale compiled MCR app, we finally reproduced the error. Subsequently, talking to MathWorks and they admit that it is a known bug and has to do with running a compiled MCR application on another computer with a different locale cause an error message to be displayed in the DOS command window if the MCR application is compiled as a DOS application and we can see the error message. But if the app is compiled as a Windows application (no DOS window while the app is running), the output error message causes MCR to crash&#8230;</p>
<p>The workaround is to compile our application as a traditional app with a DOS command window, or alternatively patch our MATLAB R2013b (MCR) or upgrade to MATLAB R2014a (where the bug is fixed).</p>
<p>So the lesson of this story is that it is really unfortunate that MathWorks is not sharing bug reports which can cause a lot of grief for MATLAB programmers&#8230;</p>
<p>Lastly, thank you Amro for sharing how to change the default character sets within MATLAB which actually might help us to avoid this bug if you had posted this a couple of weeks earlier&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Martin		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-341054</link>

		<dc:creator><![CDATA[Martin]]></dc:creator>
		<pubDate>Fri, 12 Dec 2014 10:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-341054</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340803&quot;&gt;Steve Eddins&lt;/a&gt;.

Very good and insightful comments here. Personally, I feel that nowadays the most sensible text encoding is UTF-8 and I wish it would become the default in MATLAB sooner rather than later. My workflow is very English-centric, but even I want to credit someone or reference an article once in a while, at which point I want to use all kinds of diacritics and maybe even different alphabets.

My approach to ensure this is: Check in my &lt;strong&gt;startup.m&lt;/strong&gt; that
&lt;pre lang=&quot;matlab&quot;&gt;
feature(&#039;DefaultCharacterSet&#039;)
&lt;/pre&gt;
returns UTF-8. If not, check via
&lt;pre lang=&quot;matlab&quot;&gt;
feature(&#039;Locale&#039;)
&lt;/pre&gt;
which locale MATLAB has detected for my system and alter &lt;strong&gt;$MLROOT/bin/lcdata.xml&lt;/strong&gt; accordingly (change the &lt;strong&gt;encoding&lt;/strong&gt; attribute of the matching &lt;strong&gt;locale&lt;/strong&gt; element).

I haven&#039;t really tested it, but I could imagine that there are less issues with this method than changing the encoding via the above &lt;strong&gt;feature&lt;/strong&gt; command, which would only happen after all of MATLAB is loaded and the editor has already reopened my files with the wrong encoding.

I guess the choice of UTF-16 as the internal encoding is understandable, given that this is the encoding on an API level on Windows and also the encoding underlying all of Java.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340803">Steve Eddins</a>.</p>
<p>Very good and insightful comments here. Personally, I feel that nowadays the most sensible text encoding is UTF-8 and I wish it would become the default in MATLAB sooner rather than later. My workflow is very English-centric, but even I want to credit someone or reference an article once in a while, at which point I want to use all kinds of diacritics and maybe even different alphabets.</p>
<p>My approach to ensure this is: Check in my <strong>startup.m</strong> that</p>
<pre lang="matlab">
feature('DefaultCharacterSet')
</pre>
<p>returns UTF-8. If not, check via</p>
<pre lang="matlab">
feature('Locale')
</pre>
<p>which locale MATLAB has detected for my system and alter <strong>$MLROOT/bin/lcdata.xml</strong> accordingly (change the <strong>encoding</strong> attribute of the matching <strong>locale</strong> element).</p>
<p>I haven&#8217;t really tested it, but I could imagine that there are less issues with this method than changing the encoding via the above <strong>feature</strong> command, which would only happen after all of MATLAB is loaded and the editor has already reopened my files with the wrong encoding.</p>
<p>I guess the choice of UTF-16 as the internal encoding is understandable, given that this is the encoding on an API level on Windows and also the encoding underlying all of Java.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Amro		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-341045</link>

		<dc:creator><![CDATA[Amro]]></dc:creator>
		<pubDate>Fri, 12 Dec 2014 08:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-341045</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340803&quot;&gt;Steve Eddins&lt;/a&gt;.

@SteveEddins:

Thanks for the response Steve. I took another shot at the problem, and I&#039;ve managed to work with code points outside the BMP plane this time (i.e U+010000 to U+10FFFF)!

As I&#039;ve shown before, the CHAR function unfortunately does not know how to deal with those code points directly; the trick is to use NATIVE2UNICODE function to convert a vector of bytes (encoded using any of the supported encodings) back to the abstract character they represent.

So my previous example can be written as:

&lt;pre lang=&quot;matlab&quot;&gt;
% U+10437 is encoded in UTF-8 as 4-bytes: 0xF0 0x90 0x90 0xB7
cc = native2unicode(hex2dec({&#039;F0&#039; &#039;90&#039; &#039;90&#039; &#039;B7&#039;})&#039;, &#039;UTF-8&#039;)

% MATLAB internally uses UTF-16, which in this case
% is encoded as a surrogate pair: 0xD801 0xDC37
&gt;&gt; whos cc
  Name      Size            Bytes  Class    Attributes
  cc        1x2                 4  char               

&gt;&gt; double(cc)
ans =
       55297       56375      % high/low surrogates

% using an appropriate font, R2014b is now capable of showing it in a plot!
title(cc, &#039;FontSize&#039;,144, &#039;FontName&#039;,&#039;Segoe UI Symbol&#039;)
&lt;/pre&gt;

This does confirm that MATLAB is using UTF-16 internally to represent characters, even though there are a couple of places that still need attention... Sorry for doubting you guys :)

---

I hope Yair doesn&#039;t mind me documenting this stuff here, but in the spirit of filing bugs, here are some of my findings:

- CHAR function truncates characters outside the range of BMP plane.
- even if we managed to store a non-BMP character like I did in the above example, there is a problem of &quot;leaky abstractions&quot;; the resulting character has length(cc)==2, while it&#039;s supposed to be a single character! This means that indexing into a string is messed up as well, and won&#039;t always be what we expect: str(5:10)
- the MATLAB editor does not handle files with BOM markers well (either UTF-8 or UTF-16).
- reading files with UTF-16 text using FOPEN/FREAD functions has some issues. I guess that&#039;s why UTF-16 is not listed as a supported encoding in FREAD doc page, even though it is accepted as an option value.
- the command window in the IDE has small rendering issues with Unicode text that involves combining diacritical-marks. Take for example the letter A with accents above and below: &lt;i&gt;&lt;b&gt;char&lt;/b&gt;(hex2dec({&#039;0061&#039;, &#039;0301&#039;, &#039;0317&#039;})&#039;)&lt;/i&gt; or &#039;á̗&#039;
- other advanced Unicode functionality: collation, case mapping, text segmentation, regular expressions, etc.. For instance &lt;i&gt;&lt;b&gt;sort&lt;/b&gt;({&#039;a&#039;, &#039;z&#039;, &#039;e&#039;, &#039;é&#039;, &#039;ä&#039;})&lt;/i&gt; sorts by code point value, rather than alphabetically, where the accented characters should come after the regular ones, not last after the &#039;z&#039;. Another example is case conversion where in German upper(&#039;ß&#039;) should be &#039;SS&#039;!

It&#039;s worth mentioning that MATLAB is not the only language that suffers from the &quot;UTF-16 curse&quot; (JavaScript comes to mind!). I only wish TMW had chosen UTF-8 instead, which many agree is a better encoding in general:
- http://utf8everywhere.org/
- http://programmers.stackexchange.com/questions/102205/should-utf-16-be-considered-harmful
This is especially true when working at the level of MEX-files.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340803">Steve Eddins</a>.</p>
<p>@SteveEddins:</p>
<p>Thanks for the response Steve. I took another shot at the problem, and I&#8217;ve managed to work with code points outside the BMP plane this time (i.e U+010000 to U+10FFFF)!</p>
<p>As I&#8217;ve shown before, the CHAR function unfortunately does not know how to deal with those code points directly; the trick is to use NATIVE2UNICODE function to convert a vector of bytes (encoded using any of the supported encodings) back to the abstract character they represent.</p>
<p>So my previous example can be written as:</p>
<pre lang="matlab">
% U+10437 is encoded in UTF-8 as 4-bytes: 0xF0 0x90 0x90 0xB7
cc = native2unicode(hex2dec({'F0' '90' '90' 'B7'})', 'UTF-8')

% MATLAB internally uses UTF-16, which in this case
% is encoded as a surrogate pair: 0xD801 0xDC37
>> whos cc
  Name      Size            Bytes  Class    Attributes
  cc        1x2                 4  char               

>> double(cc)
ans =
       55297       56375      % high/low surrogates

% using an appropriate font, R2014b is now capable of showing it in a plot!
title(cc, 'FontSize',144, 'FontName','Segoe UI Symbol')
</pre>
<p>This does confirm that MATLAB is using UTF-16 internally to represent characters, even though there are a couple of places that still need attention&#8230; Sorry for doubting you guys 🙂</p>
<p>&#8212;</p>
<p>I hope Yair doesn&#8217;t mind me documenting this stuff here, but in the spirit of filing bugs, here are some of my findings:</p>
<p>&#8211; CHAR function truncates characters outside the range of BMP plane.<br />
&#8211; even if we managed to store a non-BMP character like I did in the above example, there is a problem of &#8220;leaky abstractions&#8221;; the resulting character has length(cc)==2, while it&#8217;s supposed to be a single character! This means that indexing into a string is messed up as well, and won&#8217;t always be what we expect: str(5:10)<br />
&#8211; the MATLAB editor does not handle files with BOM markers well (either UTF-8 or UTF-16).<br />
&#8211; reading files with UTF-16 text using FOPEN/FREAD functions has some issues. I guess that&#8217;s why UTF-16 is not listed as a supported encoding in FREAD doc page, even though it is accepted as an option value.<br />
&#8211; the command window in the IDE has small rendering issues with Unicode text that involves combining diacritical-marks. Take for example the letter A with accents above and below: <i><b>char</b>(hex2dec({&#8216;0061&#8217;, &#8216;0301&#8217;, &#8216;0317&#8217;})&#8217;)</i> or &#8216;á̗&#8217;<br />
&#8211; other advanced Unicode functionality: collation, case mapping, text segmentation, regular expressions, etc.. For instance <i><b>sort</b>({&#8216;a&#8217;, &#8216;z&#8217;, &#8216;e&#8217;, &#8216;é&#8217;, &#8216;ä&#8217;})</i> sorts by code point value, rather than alphabetically, where the accented characters should come after the regular ones, not last after the &#8216;z&#8217;. Another example is case conversion where in German upper(&#8216;ß&#8217;) should be &#8216;SS&#8217;!</p>
<p>It&#8217;s worth mentioning that MATLAB is not the only language that suffers from the &#8220;UTF-16 curse&#8221; (JavaScript comes to mind!). I only wish TMW had chosen UTF-8 instead, which many agree is a better encoding in general:<br />
&#8211; <a href="http://utf8everywhere.org/" rel="nofollow ugc">http://utf8everywhere.org/</a><br />
&#8211; <a href="http://programmers.stackexchange.com/questions/102205/should-utf-16-be-considered-harmful" rel="nofollow ugc">http://programmers.stackexchange.com/questions/102205/should-utf-16-be-considered-harmful</a><br />
This is especially true when working at the level of MEX-files.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340992</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 11 Dec 2014 22:47:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-340992</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340931&quot;&gt;Amro&lt;/a&gt;.

@Amro - where have you been all these years?! - this would have deserved a dedicated post...

Anything else you&#039;re keeping up your sleeve?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340931">Amro</a>.</p>
<p>@Amro &#8211; where have you been all these years?! &#8211; this would have deserved a dedicated post&#8230;</p>
<p>Anything else you&#8217;re keeping up your sleeve?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Steve Eddins		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340978</link>

		<dc:creator><![CDATA[Steve Eddins]]></dc:creator>
		<pubDate>Thu, 11 Dec 2014 19:42:33 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-340978</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340803&quot;&gt;Steve Eddins&lt;/a&gt;.

MATLAB uses UTF-16 internally for character representation. Some parts of MATLAB don&#039;t know yet what to do with code points about 65535.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340803">Steve Eddins</a>.</p>
<p>MATLAB uses UTF-16 internally for character representation. Some parts of MATLAB don&#8217;t know yet what to do with code points about 65535.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Amro		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340931</link>

		<dc:creator><![CDATA[Amro]]></dc:creator>
		<pubDate>Thu, 11 Dec 2014 09:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-340931</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340803&quot;&gt;Steve Eddins&lt;/a&gt;.

@Yair: you can also make it work in R2014a and earlier, you just have to change the default character set (undocumented of course!):

&lt;pre lang=&quot;matlab&quot;&gt;
% works in R2014a
feature(&#039;DefaultCharacterSet&#039;,&#039;UTF-8&#039;)
uicontrol(&#039;String&#039;,char(1495:1499))
&lt;/pre&gt;

On my Windows machine with &quot;en-US&quot; locale, the default charset was set to &quot;windows-1252&quot;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340803">Steve Eddins</a>.</p>
<p>@Yair: you can also make it work in R2014a and earlier, you just have to change the default character set (undocumented of course!):</p>
<pre lang="matlab">
% works in R2014a
feature('DefaultCharacterSet','UTF-8')
uicontrol('String',char(1495:1499))
</pre>
<p>On my Windows machine with &#8220;en-US&#8221; locale, the default charset was set to &#8220;windows-1252&#8221;.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340930</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 11 Dec 2014 09:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5272#comment-340930</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340929&quot;&gt;Amro&lt;/a&gt;.

@Amro - you&#039;re right, my bad: I was working on 14a this morning, where uicontrols indeed do not display the non-Latin text without the Java hack. It works correctly in 14b. Sorry for the mixup.

For the reference of others, in 14a and earlier we can use the underlying Java components of the uicontrols to display non-Latin labels (unnecessary in 14b):
&lt;pre lang=&#039;matlab&#039;&gt;
hButton = uicontrol(&#039;String&#039;,char(1495:1499));  % no label displayed in 14a; ok in 14b
jButton = findjobj(hButton);
jButton.setText(char(1495:1499));  % label shown ok
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/couple-of-matlab-bugs-and-workarounds#comment-340929">Amro</a>.</p>
<p>@Amro &#8211; you&#8217;re right, my bad: I was working on 14a this morning, where uicontrols indeed do not display the non-Latin text without the Java hack. It works correctly in 14b. Sorry for the mixup.</p>
<p>For the reference of others, in 14a and earlier we can use the underlying Java components of the uicontrols to display non-Latin labels (unnecessary in 14b):</p>
<pre lang='matlab'>
hButton = uicontrol('String',char(1495:1499));  % no label displayed in 14a; ok in 14b
jButton = findjobj(hButton);
jButton.setText(char(1495:1499));  % label shown ok
</pre>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
