I've been having issues with data downloaded using a .net WebClient control, in that I seem to have little control over the encoding of the data that I get back from a web server.
The specifics of the question are in the post linked below, but I want to ask the question in a more general sense as the answer is not really helping (not the answerer's fault!).
WebClient.DownloadString() returns string with peculiar characters
The real problem is that supposedly there is no way to detect the encoding of a response from a web server, and the webserver may not respond using the encoding specified in the headers.
If this is true, how do web browsers such as IE, Firefox and Chrome work out how to decode the stream when you use the view source functionality?
It must be possible, this seems like a really fundamental requirement!