Character Disassembler
Every so often I need to convert one or more characters to their numeric equivalents. This can be especially painful when dealing with Unicode characters. So I wrote a little tool called the Character Disassembler to help out.
Given a string as input it will list each character and its respective numeric value. Then you can select any of the resulting characters in the list and copy them to the clipboard. This is useful for pasting into a source file that is stored in ASCII encoding for example. The check box instructs the tool to insert the necessary casts to be able to initialize a character array in C#.
char[] chars = { (char) 0x48, (char) 0x65, (char) 0x6C, (char) 0x6C, (char) 0x6F };
Of course, this is not needed for C++:
wchar_t chars[] = { 0x48, 0x65, 0x6C, 0x6C, 0x6F };
Download it here. It's a pretty simple little program, but if you're interested in how it works, simply use the mighty .NET Reflector.
P.S. Don't take this to mean that it's OK to store disguised strings in your source code. Its not! But it may be useful for something that is culture neutral like the character mask for password text boxes.
© 2004 Kenny Kerr