Entering Unicode data in Visual Studio, C#
\uFFFF
\UFFFFFFFF
C# Unicode character escape sequences.
The answer of Neutrino activated the Alt+Numpad input method (Microsoft Glossary), but I had to search for the correct registry path. It is:
- Navigate to HKCU\Control Panel\Input Method
I tried to write a Unicode-char within my comments in source (.
Unfortunately I cannot enter a Unicode code point, like shown in charmap
, to get the corresponding character.
- Using [Alt]+[+]+<xxxx>, where the hexadecimal Unicode code point (4-figure) replaces the xxxx, does not enter any character (neither [Numpad +] nor regular [+] key), when using the regular numeric keys.
- Meanwhile using Numpad for the 4-figured code (it has digits only), it is irrelevant to hit [+] before entering the Unicode code point. It just writes the same character like without preceding [+] (or in my case with preceding zero [0]). The entered character is the one defined in the codepage.
- Just for curiosity I have tried also using the decimal code (0x2192 = 8594) or switching the codepage via
chcp
. But it does not change anything.
Unluckily I find no way to convince Windows to enter the char with its U+xxxx code presented within Windows' own charmap
.
Luckily, there people share this problem over multiple programs, not just Visual Studio. So the folks at http://www.fileformat.info provide several tipps in an article for Windows, among them a self written UnicodeInput Utility which solves it.
Though I still think, Windows should have an built-in solution.
(PS: I would have added a comment, but my reputation is still too low.)
It appears that Visual Studio, by default, does not allow the use of many of the ALT codes. The work around is to just paste in the Unicode symbol.
1) run charmap.exe.
2) click advanced view.
3) search for the symbol you want (by name or code number).
4) copy the symbol you want.
5) paste it into your document.
charmap.exe comes standard with windows. You can use it to insert any Unicode symbol.