Support edge cases when decoding unicode strings