# encodeUtf8

`import { encodeUtf8 } from "destack:string";`

Encode text as UTF-8 bytes.

```ds title="encodeUtf8"
export function encodeUtf8(text: string): readonly [uint8]
```

[language/library/src/string/utf8.ds:22:24](https://github.com/destack-sh/destack/blob/main/language/library/src/string/utf8.ds#L22-L24)
