Note I have been using vscode as my editor with Julia 0.6.2.
“\mscrI” displays as ℐ in both the editor and ℐ the REPL.
“\mscrP” displays as 𝒫 in the editor but as � in the REPL
“\mitP” displays as 𝑃 in the editor and as � in the REPL
It is curious that some work and others do not (example 1 is fine). These are just some that I came across.
In addition, the characters display fine in the terminal (if you paste from the editor) after installing and applying the DejaVu fonts family, but still fail to show correctly in the Julia REPL. I have also tried the same using the ConEmu console emulator and get the same results (characters display fine in terminal but show up as � in REPL).
The problem seems to be Windows related since I tried example 2 with Ubuntu and the character displayed fine in the REPL.
Is this a known issue? any thoughts would be appreciated, thanks.
For the Julia and JuliaPro installations on windows, is there any way to create the shortcut to the console to use a font with better unicode support? This would make it a lot easier for users, since changing fonts is not something most windows users know how to do. Installing an appropriate font would also be very nice as well.
Minnty or Cmder or something would be nice, but low priority compared to other enhancements to the Julia environment. But just changing the font to a more unicode friendly one would be an improvement as a stop-gap.
Very likely I am missing something but I did install the DejaVu font family and set the terminal to use that. In addition I tried the example with ConEmu with UTF-8 encoding with the same result. Because the character displays correctly in the terminal when pasted but not when pasted in Julia REPL led me to believe that it is not a problem with the font itself.
Please see the image below:
I get the same result with Powershell using the DejaVu font family.
I have not tried Minnty or Cmder, that will be my next test.
I can replicate this is both Juno and VSCode. Both have DejaVu Sans Mono set as the font in both the editor and console. \mscrP displays fine in the editor, but not in the console, nor in the REPL. In all cases, Julia is running in PowerShell on Windows 10.
I have tried with Cmder & Mintty. Cmder also do not display all the fonts correctly (fonts based on Conemu I believe). The fonts do work by installing Cygwin & Mintty. However, it does not seem to be possible to use Mintty as an integrated terminal within VScode (only an external terminal).
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:
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?
OK, back from holiday, so I had time to run a little test. Turns out it is a bit deeper. If I run Julia inside Git Bash, with the same font, all of \scrA to \scrZ actually display just fine. Running Julia inside PowerShell or the Windows console still displays placeholders instead, even though the characters display just fine in Atom. Git bash (mintty) is set to use UTF-8, which - to my knowledge - the Windows console does not handle properly.
Bit late to the game, but this seems to basically be the explanation: utf 8 - Why are there holes in the Unicode table? - Stack Overflow (for whatever reason, probably popularity and demand, the U+21... characters were added before the U+01d4... set, and were then left out when the U+01d4... set was introduced to avoid duplicated characters and preserve backward compatibility).
Sorry to resurrect an old thread, but I wanted to note that there is a simple explanation for this puzzle: when a glyph is not present for a character in a given font, decent text-rendering software switches to a “fallback” font to find a glyph for that character. Mintty (used by git bash) supports fallback fonts, but the Windows console does not. So, probably your font does not have the \scrA character, but Mintty switches to a fallback font whereas the Windows console gives up. This has nothing to do with UTF-8.
Note though that currently julia (or rather the julia fork of libuv) does not play nicely with the new Windows Terminal. Details are here, but the short version is that julia currently is not using the right way to interact with the console on Windows to utilize the features now supported in Windows Terminal.
Sorry to resurrect an old thread, but I found a way to automate running Julia in Mintty with one click in Windows 7. I hope this will be useful for other readers in this thread.
Basically I created a batch file with two lines and saved it to the desktop. This batch file does the following:
1 - It adds Julia and Mintty to the path local to this batch file (first line);
2 - It calls mintty passing julia as a command that should be executed by mintty (second line).
Example of a batch file created to open Julia 1.6.2 in Mintty (file julia_1_6_2.bat, saved in the desktop):
mintty -h -e julia
By some strange reason, if mintty and julia are not in the path (first line in the batch file above), julia crashes.