views:

45

answers:

2

What kind of char is this and how do I convert it to a text in c#/vb.net?

alt text

I opened a .dat file in notepad, took a screenshot and attached it here.

A: 

You'll need to use a hex editor to find the exact ASCII code (assuming the file is ASCII, which seems to be an entirely incorrect assumption) that the file contains. It's safe to say that whatever byte sequence is contained in the file is not a printable character in whatever encoding the editor used to open the file, and that is why it used that graphic in place of the actual character.

Mark
Do you think I could just paste the values in some online hex to ascii editor to see the values?
vikasde
I don't know if such a thing exists as an online hex editor. There are free and easy-to-use hex editors available, however. You might want to look into one of those.
Mark
+1  A: 

Your screenshot looks like the digits "0003" in box. This is a common way to display characters for which a glyph isn't available.

U+0003 is the "END OF TEXT" control character. It's unlikely to occur within a text file, but a ".dat" file might be a mixture of text and binary data.

dan04