force encoding to utf-8 before hashing to md5

this avoids encoding errors when urls have unicode chars.