RUBY-779 Raise error if utf-8 string is not valid