Does anyone know how to display SOH (Start Of Heading) in Visual Studio Text Editor
I would like to display the SOH character that corresponds to 1 byte
In the command prompt, it looks like this : ☺
In Visual studio text editor, it does not appear…
Thanks
The Visual Studio 2010 text editor is perfectly capable of displaying the SOH character (U+0001) and hopefully your browser will too: ‘☺’.
In Visual Studio you can create a new text file and press Alt Num Pad 1 to enter an SOH character. However, when you save the file Visual Studio will prompt you to save it using UNICODE. If you answer yes Visual Studio will encode the file using UTF-8 (including a BOM). The resulting file contains the following bytes:
I suspect that you are trying to use the editor to open a file that isn’t encoded that contains special characters like SOH. Visual Studio will not be able to open these files in the text editor (however, you can try the binary editor).
You need to UTF-8 encode the file having the SOH character. In .NET you can easily UTF-8 encode a string into bytes: