>
> UTF8 is a variable-width encoding so if the buffer is >100kB and a valid
> multi-byte UTF8 encoded character happens to fall across the boundary of
> buffers in subsequent loop iterations you might get either an incorrect
> decoding or an exception thrown.
>

Right, decoding the bytes in fixed blocks with GetString is very fragile.
If you want to make a string out of unpredictable chunks of bytes (as they
would come out of a network stream for example) you need to use this:

http://msdn.microsoft.com/en-us/library/system.text.encoding.getencoder.aspx

This is just a side issue to your original post.

Greg K

Reply via email to