Skip to main content
Version: Latest-3.2

url_encode

Description

Translates a string into the application/x-www-form-urlencoded format.

This functions is supported from v3.2.

Syntax

VARCHAR url_encode(VARCHAR str)

Parameters

  • str: the string to encode. If str is not a string, this function will try implicit cast first.

Return value

Returns an encoded string compliant with the application/x-www-form-urlencoded format.

Examples

mysql> select url_encode('https://docs.starrocks.io/docs/introduction/StarRocks_intro/');
+----------------------------------------------------------------------------+
| url_encode('https://docs.starrocks.io/docs/introduction/StarRocks_intro/') |
+----------------------------------------------------------------------------+
| https%3A%2F%2Fdocs.starrocks.io%2Fdocs%2Fintroduction%2FStarRocks_intro%2F |
+----------------------------------------------------------------------------+