C#- How to handle string terminator in the conversion -
One of my binary arrays is the string in the conversion process, due to some data my string ends. And it ignores the next data. Take a look at my code, is there any mistake?
str + = (four) chunky data [index]. Ostring ();
Later I want to display it on the textbox. My array includes the following data as appearing in the hex editor.
X UB`````` * * * Beacomb '¨ ... Y8ÄX¡ ~ A ‰ "yuZs ~ # μjÑ, i @ SI4" È0
I tried to do this but nothing changed .. str = system.Text.Encoding.ASCII.GetString (chunkData);
You should not use text to represent arbitrary binary data. If you actually use encoding, then you will lose almost definitly data.
If you really want to change arbitrary binary data on text and back, use it and
For termination: NIT strings do not rely on expiration characters themselves, but many UI controls (including textbox
) treat Will '\ 0' as a termination character
Comments
Post a Comment