Encode data in UTF-8 before encode URL

It fixes the error "UnicodeDecodeError: 'ascii' codec can't decode byte..." during URL encoding (with special characters).