Improve error messages bytes/unicode conversion functions.