Fix #6011 - fixing surrogate characters