Convert value to string before encoding.

Closes #23.