You simply assume that the object is in UTF-8 when creating your stream reader without explicitly setting the encoding. You should examine the CharacterSet HttpWebResponse (not displayed by the WebResponse base class) and open the StreamReader with the appropriate encoding.
Otherwise, if he reads something that is not UTF-8, as if it were UTF-8, he would encounter octet sequences that are invalid in UTF-8 and should replace the replacement character U + FFFD ( ) as the best he can do.
WebClient does pretty much this: DownloadString is a higher-level method where WebRequest and its derived classes let you go down, it has one call to "send a GET request to the URI to see what content encoding is used, in case you need to disable or disable it, see what character encoding is in place, configure a text reader with this encoding and stream, and then call ReadAll() . " Normal high level instructions - large chunks and low profile junior ones - instructions and cons apply.
source share