In this convert function
public static byte[] GetBytes(string str)
{
byte[] bytes = new byte[str.Length * sizeof(char)];
System.Buffer.BlockCopy(str.ToCh
In reality .net (at least for 4.0) automatically changes size of char when serialized with BinaryWriter
UTF-8 chars have variable length (might not be 1 byte), ASCII chars have 1 byte
'ē' = 2 bytes
'e' = 1 byte
It must be kept in mind when using
BinaryReader.ReadChars(stream)
In case of word "ēvalds" = 7 bytes size will be different than "evalds" = 6 bytes