Message Boards Message Boards

Reproduce all characters using FromCharacterCode?

Performing some text analysis I encountered the following trouble. Mathematica cannot display the text symbols with code 128 through 160. E.g., standard output with the FromCharacterCode function looks like enter image description here

When using Style for output: enter image description here

This problem persists for all font families. For displaying symbols the following code was used:

Table[ {q,   
  Style[  FromCharacterCode[q], FontFamily -> "Tahoma", 
   FontSize -> 25, FontColor -> Red]}, {q, 33, 255}]

(In FontFamily any font can be substituted, result will be the same.)

I suppose the problem may be OS-depending, so kindly ask colleagues to reproduce it on different platforms (I use WM 12.0, Windows 10 x64).

POSTED BY: Konstantin Nosov
5 Replies

I think Henrik is right insofar as Unicode decimal 127-159 are undefined and as such should not be expected to map to visible glyphs (160 is a non-breaking space). But what MMA seems to be offering here is some ad hoc support for ISO 8859-15 characters. On Windows, as Konstantin noticed, this should result in no visible glyphs at all. On my Mac, however (MMA v12), it produces this:

enter image description here

So, I guess, to "fix" it, MMA would need to fully support 8859-15 for this range, and on Windows, ISO Windows 1252. But in today's Unicode world, both encodings are obsolete and the glyphs in this range have new encodings. Compare, for example (OSX only), the old and new encodings and glyphs for the Euro symbol €:

enter image description here

So, probably, yes, it's still a 'bug' but one which is already fixed.

POSTED BY: Arno Bosse

In fact, I try to display symbols (words) from Voynich Manuscript (font v101, http://www.voynich.nu/transcr.html) for presenting results of analysis. I've reproduced the majority of symbols, but some remain invisible or wrong-looking. With use of the "encoding" option in FromCharacterCode it is possible to display the range 149-158 enter image description here

This is impossible without "encoding", as I did earlier.

Code:

Table[   {q,   
  Style[  FromCharacterCode[q, "MacintoshRomanian"], 
   FontFamily -> "Voynich", FontSize -> 25, FontColor -> Red]}, {q, 
  149, 158}]

I hope that picking a proper encoding will help to display all others symbols. Thanks for assistance.

POSTED BY: Konstantin Nosov

A simple search on the web suggests that those "gaps" are simply undefined (in HTML 4, e.g. here or here). Which characters are missing, what output do you expect?

POSTED BY: Henrik Schachner

I don't speak on HTML symbols. These symbols are in most fonts. E.g., MS Word enables to insert them in a document.

enter image description here

POSTED BY: Konstantin Nosov

If I add the encoding, for example FromCharacterCode[q, "UTF8"], I get some error messages that may be helpful.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract