Does Matlab 2010b intentionally omit char(8240) and others or is this a bug with a fix?

3 views (last 30 days)
Many of the char codes for symbols return a blank in Matlab 2010b. Anyone know of a fix? char(8240) (permil). Did they get renumbered? Thank you.

Answers (3)

Andrew Newell
Andrew Newell on 11 Feb 2011
Maybe this is bug 312955, for which there is no workaround.
  4 Comments
Walter Roberson
Walter Roberson on 11 Feb 2011
I've been doing some checking around and it looks like the above is probably not going to work.
Hunting around, it appears that LaTex was not designed for Unicode, and that non-trivial add-on packages have to be used. I looked briefly at using add-on packages a few months ago, but it _looked_ to me as if the Matlab latex interpreter was not able to import packages.
Andrew Newell
Andrew Newell on 11 Feb 2011
Of course, if the problem is displaying Unicode, a latex implementation might not work anyway.

Sign in to comment.


Walter Roberson
Walter Roberson on 11 Feb 2011
So if you type
char(8240)
at the prompt, you get a blank?
I'd be almost certain they didn't get renumbered, as the scheme used is UTF-16 encoding of Unicode, and that hasn't changed.
I would check for possible font issues on your side.

Andrew Newell
Andrew Newell on 11 Feb 2011
On my computer,
char(8240)
displays a blank, but the permil sign is visible in the workspace display for ans. So it is not a numbering issue.
I also tried displaying it on a figure using text and saving it to a file, and the permil sign does not appear. Yet in this post, the char codes for em- and en-dashes work.
  2 Comments
Santosh Kasula
Santosh Kasula on 11 Feb 2011
Andy, moving your answer to comment section.
My original post above is on a Mac. A windows machine with the same version and the same font structure displays char(8240) at the prompt. I also get the same result as Andrew above with the permil symbol showing up in the workspace. I have tried changing fonts with no joy.
Walter Roberson
Walter Roberson on 11 Feb 2011
8240 needs three bytes to encode in UTF-8. Experimentally, it appears that Matlab is doing a unicode2native() operation on the string and passing those bytes, and that most of the fonts are decoding the characters separately.
I have not been able to find a way around this as yet.

Sign in to comment.

Categories

Find more on Characters and Strings 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!