<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def safequote_restbase(title):
 """ Safequote restbase title possibly having slash in title """

    try:
        return quote(title.encode('utf-8'), safe='')
    except UnicodeDecodeError:
        return quote(title, safe='')