Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #python
- #比较输入和抓取到unicode中文串
- def ApkNameIsRight(keyword,apkName):
- keyword = keyword.decode("GB2312") #用户输入
- return keyword==hex2u(apkName)
- #把"中文"转u"中文"真有这么烦么...
- def hex2u(hexStr):
- result = ''
- for i in range(len(hexStr)/6):
- result += unichr(int(hexStr[i*6+2:i*6+6], 16))
- return result
- u = "\u5df2\u7248" #假设抓取到的格式...混合字串还得改OJZ
- x = raw_input("x")
- print ApkNameIsRight(x,u)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement