def METHOD_NAME(value: str, /) -> str:
    try:
        value.encode('latin-1')
        return value
    except UnicodeEncodeError as ue:
        invalid_char = value[ue.start:ue.end]
        encoded_char = urllib.parse.quote(invalid_char)
        value = value.replace(invalid_char, encoded_char)
        return METHOD_NAME(value)