Encode unicode strings before passing it to md5.