<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def urlencode(resource):
 """ This implementation of urlencode supports all unicode characters :param: resource: Resource value to be url encoded. """

    if isinstance(resource, str):
        return _urlencode(resource.encode('utf-8'))

    return _urlencode(resource)