utils.web: Add function get_encoding.
Web: Use utils.web.get_encoding for guessing charset.