Handle any text value passed to the Encoder

Explicitly check for None so we catch empty unicode strings. Fixes #46