Encoding detector library ported from Mozilla
