1. #!/usr/bin/env python 
2. #coding=utf-8 
3. 
4. def get_Mutil_CnFirstLetter(str):
5.     index = 0;
6. ""
7. "len(str)=%s"
8. while index < (len(str)-1): 
9.         #print "strReturnCn=%s" % strReturnCn 
10.         #print get_cn_first_letter(str[index:index+2],"GBK") 
11.         #print str[index:index+2] 
12. "GBK")
13.         index += 2;
14. return
15. 
16. def get_cn_first_letter(str,codec="UTF8"):
17. if codec!="GBK":
18. if codec!="unicode":
19.             str=str.decode(codec)
20. "GBK")
21.     
22. if str<"/xb0/xa1" or str>"/xd7/xf9":
23. return ""
24. if str<"/xb0/xc4":
25. return "a"
26. if str<"/xb2/xc0":
27. return "b"
28. if str<"/xb4/xed":
29. return "c"
30. if str<"/xb6/xe9":
31. return "d"
32. if str<"/xb7/xa1":
33. return "e"
34. if str<"/xb8/xc0":
35. return "f"
36. if str<"/xb9/xfd":
37. return "g"
38. if str<"/xbb/xf6":
39. return "h"
40. if str<"/xbf/xa5":
41. return "j"
42. if str<"/xc0/xab":
43. return "k"
44. if str<"/xc2/xe7":
45. return "l"
46. if str<"/xc4/xc2":
47. return "m"
48. if str<"/xc5/xb5":
49. return "n"
50. if str<"/xc5/xbd":
51. return "o"
52. if str<"/xc6/xd9":
53. return "p"
54. if str<"/xc8/xba":
55. return "q"
56. if str<"/xc8/xf5":
57. return "r"
58. if str<"/xcb/xf9":
59. return "s"
60. if str<"/xcd/xd9":
61. return "t"
62. if str<"/xce/xf3":
63. return "w"
64. if str<"/xd1/x88":
65. return "x"
66. if str<"/xd4/xd0":
67. return "y"
68. if str<"/xd7/xf9":
69. return "z"
70. 
71. if __name__== '__main__':
72. "我", "GBK")
73. "们", "GBK")
74. "他", "GBK")
75. "是", "GBK")
76. "大", "GBK")
77. "大埔的d")