raise when Boolean.encoding or decoding text was invalid
text_type -> string_type. add test codes