(value, encoding=None)
return retVal
Returns 8-bit string representation of the supplied unicode value

    >>> unicodeencode(u'foobar')
    'foobar'
Returns 8-bit string representation of the supplied unicode value
Returns 8 - bit string representation of the supplied unicode value
def unicodeencode(value, encoding=None):
    """
    Returns 8-bit string representation of the supplied unicode value

    >>> unicodeencode(u'foobar')
    'foobar'
    """

    retVal = value
    if isinstance(value, unicode):
        try:
            retVal = value.encode(encoding or UNICODE_ENCODING)
        except UnicodeEncodeError:
            retVal = value.encode(UNICODE_ENCODING, "replace")
    return retVal
def unicodeencode ( value , encoding = None ) : retVal = value if isinstance ( value , unicode ) : try : retVal = value . encode ( encoding or UNICODE_ENCODING ) except UnicodeEncodeError : retVal = value . encode ( UNICODE_ENCODING , "replace" ) return retVal