Fix tests failure when chardet module is missed