Use encoded filename for checksum

This is a better solution because most of the time the filename
to check the checksum is encoded.