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

3 次查看(过去 30 天)
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.

回答(3 个)

Andrew Newell
Andrew Newell 2011-2-11
Maybe this is bug 312955, for which there is no workaround.
  4 个评论
Walter Roberson
Walter Roberson 2011-2-11
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.

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2011-2-11
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 2011-2-11
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 个评论
Santosh Kasula
Santosh Kasula 2011-2-11
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 2011-2-11
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by