Implement generator encoders for text strings and byte strings