Oct-24-2018, 02:28 PM
(Oct-24-2018, 01:31 PM)snippsat Wrote:(Oct-24-2018, 11:51 AM)Blackklegend Wrote: Which should have been(atleast what i want to get):There is
b'ä¼qh8±\æüÕ'mbcs
encoding for Windows that can convert between ANSI and Unicode.
>>> s = b'\xe4'b'\xbc'b'q'b'h'b'8'b'\xb1'b'\\'b'\xe6'b'\xfc'b'\xd5' >>> d = s.decode('mbcs') >>> d 'ä¼qh8±\\æüÕ' >>> print(d) ä¼qh8±\æüÕ >>> 'ä¼qh8±\æüÕ' == d True
Thank you for the tip but I went on an did it manually before reading your reply.
(Oct-23-2018, 11:55 PM)micseydel Wrote: Do you mean ASCII? This should be pretty easy. Loop over the string two characters at a time, call int() with those two characters and 16, then use chr() to convert the generated number into a character.
After reading this carefully I got the following code:
ch="E4BC716838B15CE6FCD5" for i in range(1,(len(ch)//2)+1): Lh='' Lh=ch[2*i-2:2*i] x = int(Lh,16) print(chr(x),end=' ')