doc-exports/docs/dli/sqlreference/dli_spark_url_encode.html
Su, Xiaomeng 76a5b1ee83 dli_sqlreference_20240227
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2024-03-27 22:02:33 +00:00

5.3 KiB

url_encode

This function is used to encode a string in the application/x-www-form-urlencoded MIME format.

Syntax

url_encode(string <input>[, string <encoding>])

Parameters

Table 1 Parameters

Parameter

Mandatory

Type

Description

input

Yes

STRING

String to be entered

endcoding

No

STRING

Encoding format. Standard encoding formats such as GBK and UTF-8 are supported. If this parameter is not specified, UTF-8 is used by default.

Return Values

The return value is of the STRING type.

If the value of input or encoding is NULL, NULL is returned.

Example Code

The value Example+for+url_encode+%3A%2F%2F+dsf%28fasfs%29 is returned.

select url_encode('Example for url_encode:// dsf(fasfs)', 'GBK');