support for encoding more than just bytes, sanity checks