I\'m working on serial port, transmitting and receiving data to some hardware at 8bit data. I would like to store it as string to facilitate comparison, and preset data are
Why not just use an array of bytes instead? It would have none of the encoding problems you're likely to suffer with the text approach.