fixing utf8 related crashes