Always make sure error is not NULL.
Support non-ASCII values.