Refined regex that extracts charset from HTTP content-type header, to account for things like single or double quotes, extra whitespace or extra semicolons.
Also if no valid charset can be extracted from the HTTP content-type header, utf-8 is used by default.
↧