Fix check for string encodings.