downloaded a text file using WebClient.DownloadString the downloaded string is unreadable. the encoding must be wrong.
how can i convert it to a re开发者_开发百科adable string, what method do i need to use?
i don't know which encoding it is.
If you use something like LiveHTTPHeaders in firefox you'll be able to see the encoding that is being used - if it's a web page!
Maybe convert the returned string back to a byte[] (Using whatever WebClient.Encoding is set) then using a streamreader to read it back in. I'm not sure how much checking DownloadString tries to do (Though it would appear to be none), but the streamreader will attempt to detect encoding up to a point.
精彩评论