函数如下,
def get_cn_first_letter(str,codec="UTF8"):
if codec!="GBK":
if codec!="unicode":
str=str.decode(codec)
str=str.encode("GBK")
if str"\xd7\xf9":
return ""
if str
return "a"
if str
return "b"
if str
return "c"
if str
return "d"
if str
return "e"
if str
return "f"
if str
return "g"
if str
return "h"
if str
return "j"
if str
return "k"
if str
return "l"
if str
return "m"
if str
return "n"
if str
return "o"
if str
return "p"
if str
return "q"
if str
return "r"
if str
return "s"
if str
return "t"
if str
return "w"
if str
return "x"
if str
return "y"
if str
return "z"