fix a bug for words with non-encodable characters

this showed in a dictionary with freq info, test case added ("a" is in
the dictionary and has "T" frequency class, so SEQUENCE_IS_A_PREFIX is
found for non-encodable "aõh").