urlencode()

Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme.

Syntax

urlencode(STR_EXPR[, CHARSET])
Required Parameters
STR_EXPR
Source string expression. If the expression is null, the function returns null.
Optional Parameters
CHARSET
Character set (default: utf-8). Use the preferred MIME name or aliases registered in the following document: http://www.iana.org/assignments/character-sets/character-sets.xhtml

Usage

json "{'uri': '퍼센트_인코딩'}" 
| eval
  decode=concat(
    "https://ko.wikipedia.org/wiki/",
    urlencode(field("uri"), "utf-8")
  )
 => https://ko.wikipedia.org/wiki/%ED%8D%BC%EC%84%BC%ED%8A%B8_%EC%9D%B8%EC%BD%94%EB%94%A9

json "{}" | eval _line=urlencode(null) => null