(obj, encoding='utf-8')
return obj.decode(encoding)
Makes sure the string is unicode string.

    :param obj: Python 2 string, Python 3 byte string, Unicode string to decode
    :param encoding: The encoding to use
    :return: THe unicode string the was decoded
Makes sure the string is unicode string.
Makes sure the string is unicode string .
def to_unicode(obj, encoding='utf-8'):
    """
    Makes sure the string is unicode string.

    :param obj: Python 2 string, Python 3 byte string, Unicode string to decode
    :param encoding: The encoding to use
    :return: THe unicode string the was decoded
    """
    if isinstance(obj, str):
        return obj

    return obj.decode(encoding)
def to_unicode ( obj , encoding = 'utf-8' ) : if isinstance ( obj , str ) : return obj return obj . decode ( encoding )