To keep in line with bitcoin core, unsafe string are sanitized instead of
causing the task to abort.