Added charset detector copied from the Jericho parsing library.