Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine the encoding of a webresponse stream?

Tags:

c#

webresponse

How to determine the encoding of a webresponse stream ?

like image 831
Vladimir Georgiev Avatar asked Jan 01 '26 04:01

Vladimir Georgiev


1 Answers

I presume you're interested in HTML content. Actually this is not really an easy task. What most browsers do is use the encoding, the unicode bytes (at the start of your document) and HTML headers as hints, while trying different charsets to see if there's a '

The details of the algorithm are outlined in 8.2.2.1 of the HTML5 specification, see: http://www.w3.org/html/wg/drafts/html/master/single-page.html .

like image 65
atlaste Avatar answered Jan 02 '26 21:01

atlaste



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!