Hello,
I try convert \xe6\xe6\xe6 this text to normal alphabet.I saw in zntxhan.py
Resultly Is there another way for convert?
# Zntx Begin
#-------------------------------------------------------------PHP Code:def pycod(s):
try:
while 1:
m = s.find('\\x')
if (m == -1):
break
try:
s = s.replace(s[m:(m + 4)], s[(m + 2):(m + 4)].decode('hex'))
except:
break
return s
except:
# Zntx End
# My Code
s = s.decode("latin_1").encode("charmap").decode("u8")
return s
# My Code Begin
def pydecod(s):
try:
s = s.decode("charmap").encode("latin_1").encode("hex")
for i in xrange(0,len(s),2):
a = "\\x"+s[i:i+2]
print a
except:
return 0
# My Code End
print pycod("\xe6")
print pydecod("汉化风暴")


Reply With Quote

