MATLAB Answers

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

7 views (last 30 days)
Andy
Andy on 11 Feb 2011
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
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
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.

Community Treasure Hunt

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

Start Hunting!