Fixed #21269 -- Don't crash when CommandError contains non-ascii

Thanks kontakt@eikefoken.de for the report.