Fix to check validity of encoding in TorrentParser._calc_info_hash