---
updatedAt: 2025-12-05T18:41:41.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# encode_uri

```
encode_uri(str: string) -> string
```

Replace certain characters in a string with %-encoded escape sequences.

Letters A-Z a-z, digits 0-9, and !#$&'()\*+,-./:;=?@ remain unchanged. All others are encoded. NULL if input contains an invalid UTF-8 surrogate sequence.

See also encode\_uri\_component, encode\_base64.

# Domain

This is a scalar function (calculates a single output value for a single input row).

# Categories

* [String](function#string-functions)

# Examples

<OpalCodeBlock code={
`make_col e:encode_uri('2^3 = 8;')
`}/>

The result of the encoding is '2%5E3%20=%208;', which is different from `encode_uri_component`