handle non-UTF8 characters better