Morten Wennevik said:
Hi Mikolas,
The default constructor for BinaryReader is set to use UTF8 encoding
which
will be ascii for the first 127 byte characters but will mean unicode
for
characters above 127 (ie reading two bytes etc).
Use the encoding used in the text. This will create a reader with the
default windows page on your machine.
BinaryReader br = new BinaryReader(stream, Encoding.Default);
I admit I don't know much about all those different encodings, but
.Default
sounds a bit dangerous since I'm writing code that should be running on
different devices. So should I use UnicodeEncoding and then mask the
desired
byte?
thanks,
mikolas