def METHOD_NAME(text):
    """Properly encode input text to make it satisfy named URL convention.
    Args:
        text: the original string to be encoded.
    Return:
        The encoded string
    Raises:
        N/A
    """
    for c in URL_PATH_RESERVED_CHARSET:
        if c in text:
            text = text.replace(c, URL_PATH_RESERVED_CHARSET[c])
    text = text.replace(NAMED_URL_RES_INNER_DILIMITER, '[%s]' % NAMED_URL_RES_INNER_DILIMITER)
    return text