Reputation: 185
My goal is something like this
Input:
"ABC"
Output:
[0x0041, 0x0042, 0x0043]
The outputs are corrosponding UTF-16 value of each character. How do I get the numeric(BIN/HEX/DEC) UTF-16 value from a string or single character?
Upvotes: 0
Views: 234
Reputation: 774
for Python 3, you can do that as follows:
for i in "ABC":
print(hex(ord(i)))
0x41 0x42 0x43
Upvotes: 1