#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2020/4/22 0022 下午 2:07
# @Author  : hj
# @File    : re_companyName.py
# @Software: PyCharm

def strQ2B(companyname):
    """公司名称全角转半角"""
    name = ""
    for uchar in companyname:
        inside_code=ord(uchar)
        if inside_code == 12288:                              #全角空格直接转换
            inside_code = 32
        elif (inside_code >= 65281 and inside_code <= 65374): #全角字符（除空格）根据关系转化
            inside_code -= 65248
        name += chr(inside_code)
    return name