Add a utility method for only un-escaping valid utf and supply a test as well as test data for this issue. Fixes task-22594.