Speculative fix for handling malformed characters