\mscr unicode character display in REPL with Windows

I think this is neither a Julia nor even a Windows problem. I think what Stefan said near the top is correct: these characters are simply missing in the font you’re using. My guess is that you only see them in your editor because it tries to be helpful and replaces missing characters with glyphs from some other font.

I think something similar is going on in the Markdown rendering as well. Look carefully at the println() statement above: the characters for B, E, F, H etc. are styled differently than A, C, D, G etc., and are clearly from a different font.

We can get a clue as to why these particular characters behave differently from a few lines of Julia:

julia> s = "𝒜, ℬ, 𝒞, 𝒟, ℰ, ℱ, 𝒢, ℋ, ℐ, 𝒥, 𝒦, ℒ, ℳ, 𝒩, 𝒪, 𝒫, 𝒬, ℛ, 𝒮, 𝒯, 𝒰, 𝒱, 𝒲, 𝒳, 𝒴, 𝒵";

julia> for i in eachindex(s)
         (s[i]==',' || s[i]==' ') && continue
         display(s[i])
       end
'𝒜': Unicode U+01d49c (category Lu: Letter, uppercase)
'ℬ': Unicode U+212c (category Lu: Letter, uppercase)
'𝒞': Unicode U+01d49e (category Lu: Letter, uppercase)
'𝒟': Unicode U+01d49f (category Lu: Letter, uppercase)
'ℰ': Unicode U+2130 (category Lu: Letter, uppercase)
'ℱ': Unicode U+2131 (category Lu: Letter, uppercase)
'𝒢': Unicode U+01d4a2 (category Lu: Letter, uppercase)
'ℋ': Unicode U+210b (category Lu: Letter, uppercase)
'ℐ': Unicode U+2110 (category Lu: Letter, uppercase)
'𝒥': Unicode U+01d4a5 (category Lu: Letter, uppercase)
'𝒦': Unicode U+01d4a6 (category Lu: Letter, uppercase)
'ℒ': Unicode U+2112 (category Lu: Letter, uppercase)
'ℳ': Unicode U+2133 (category Lu: Letter, uppercase)
'𝒩': Unicode U+01d4a9 (category Lu: Letter, uppercase)
'𝒪': Unicode U+01d4aa (category Lu: Letter, uppercase)
'𝒫': Unicode U+01d4ab (category Lu: Letter, uppercase)
'𝒬': Unicode U+01d4ac (category Lu: Letter, uppercase)
'ℛ': Unicode U+211b (category Lu: Letter, uppercase)
'𝒮': Unicode U+01d4ae (category Lu: Letter, uppercase)
'𝒯': Unicode U+01d4af (category Lu: Letter, uppercase)
'𝒰': Unicode U+01d4b0 (category Lu: Letter, uppercase)
'𝒱': Unicode U+01d4b1 (category Lu: Letter, uppercase)
'𝒲': Unicode U+01d4b2 (category Lu: Letter, uppercase)
'𝒳': Unicode U+01d4b3 (category Lu: Letter, uppercase)
'𝒴': Unicode U+01d4b4 (category Lu: Letter, uppercase)
'𝒵': Unicode U+01d4b5 (category Lu: Letter, uppercase)

The reason is that there are two completely different regions of Unicode involved here. I have no idea why related characters are so jumbled in Unicode.

EDIT: Also, Markdown’s syntax highlighting for Julia renders the characters in the lower Unicode region in red. So weird.

I suspect that the only way to solve this is to keep looking for a font that supports all these characters. Or maybe build your own chimera font by copying glyphs from fonts that support different regions?

2 Likes