How do I accomplish random reads of a UTF8 file
问题 My understanding is that reads to a UTF8 or UTF16 Encoded file can't necessarily be random because of the occasional surrogate byte (used in Eastern languages for example). How can I use .NET to skip to an approximate position within the file, and read the unicode text from a semi-random position? Do I discard surrogate bytes and wait for a word break to continue reading? If so, what are the valid word breaks I should wait for until I start the decoding? 回答1: Easy, UTF-8 is self-synchronizing