Encode any string for safe use in URLs. Converts spaces, special characters, and Unicode into percent-encoded format compliant with RFC 3986.