add expected_encoding parameter in constructor
lift .strip() up into str normalisation
use .isupper()
use .endswith