0

I've noticed that I can paste all kind of unicode characters into Visual Studio 2013 and they show up just fine. But if I try the same trick in Notepad++, using the same font, they don't show up. So Visual Studio must be supplementing the chosen font with additional characters from somewhere else. Where? Is it like CSS where there's a font family definition somewhere (can you change it?) or is this some weird special behavior where it just happens to have a bunch of unicode symbols on hand?

EDIT: Experimenting with it a bit more, the special characters in question seem to appear in windows notepad and a few other programs after all. It mainly seems that Notepad++ is having trouble with them, despite adjustments to encoding and font settings.

0

This feature is not on Visual Studio, the fonts containing unicode characters have to be installed on your system. You can show this characters in notepad as well, that is the question of format: Displaying Unicode in Notepad

Different software programs encode characters in different ways. Notepad can manage text encoded in several formats such as ANSI, Unicode and UTF-8. Find these options by clicking the "Encoding" button on Notepad's Save As window. After creating or updating text in a document, you can select one of these encoding options in which to save the file. If you do not choose an option, Notepad saves your document in its default ANSI format.

0

The technique is known as font substitution. A web browser for example will try to find a font with the matching character - I think Firefox has a list of fonts to try first based on the language, and then presumably does some other magic if it doesn't find it.

It appears that GDI can use a few different forms of font substitution, though it's hard to find a lot of details. This oldish looking MSDN doc gives some details on what windows appears to do. This lists some of the fonts used for various languages.

I don't know why it would work in Visual Studio and not notepad though. It's possible that VS is doing something beyond the standard Windows API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.