add more clarity to error when encoding to utf-8