don't bail out completely when an illegal based integer is found
fix detection of file's encoding
updated scanner tests