<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def websafe(val):
 r"""Converts `val` so that it is safe for use in Unicode HTML. u'&lt;&#39;&amp;&quot;&gt;' u'' u'\u203d' u'\u203d' """

    if val is None:
        return u''
    elif isinstance(val, str):
        val = val.decode('utf-8')
    elif not isinstance(val, unicode):
        val = unicode(val)
        
    return htmlquote(val)