It say’s that pefile python module v1.2.8 is able to handle unicode characters.
I have 1.2.10 installed, but still, I encountered exceptions when passing
files with Japanesse filename(s). How will I pass PE files with filename having UnicodeCharacters?
# -*- coding: utf8 -*-
import pefile
pe = pefile.PE(str("c:/temp/じゃyそn.exe").decode('utf-8'))
Snippet code above gives this exception:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 37-194: ordinal
not in range(128)
How should I handle this?
Thanks in advance!
str() isn’t unicode().
Try using a unicode bytestring (notice the ‘u’ before the “.:
And then read this:
http://www.joelonsoftware.com/articles/Unicode.html