def trans_coding(data):
    """
    @brief      Transform string to unicode
    @param      data  String
    @return     unicode
    """
    if not data:
        return data
    result = None
    if type(data) == unicode:
        result = data
    elif type(data) == str:
        result = data.decode('utf-8')
    return result

    @brief      Transform string to unicode
    @param      data  String
    @return     unicode
    
wxbot_project_py2.7/wechat/utils.py