---
name: "tickit_utf8_put"
section: "3"
platform: "linux"
package: "libtickit-dev"
version: "0.4.3-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/tickit_utf8_put"
---

# tickit\_utf8\_put(3)

append a UTF-8 encoded codepoint to a buffer

## NAME

tickit\_utf8\_put - append a UTF-8 encoded codepoint to a buffer

## SYNOPSIS

```
#include <tickit.h>

size_t tickit_utf8_put(char *str, size_t len, long codepoint);
```

Link with *-ltickit*.

## DESCRIPTION

**tickit\_utf8\_put**() appends bytes into a buffer to represent the given codepoint. The UTF-8 bytes will be appended directly starting from *str*, and the function then returns the total number of bytes appended. The length of the buffer should be given to as *len*; if the buffer is not long enough then it is left unmodified and -1 is returned instead. If *str* is NULL then the function will simply return the number of bytes it would need to append to represent the codepoint.

This function does not expect the buffer to be NUL-terminated, and it will not terminate the buffer with a NUL byte on completion.

## RETURN VALUE

**tickit\_utf8\_put**() returns the number of bytes appended to the buffer, or -1 if the buffer was not long enough.

## SEE ALSO

[**tickit\_utf8\_seqlen**(3)](/tickit_utf8_seqlen/3.md), [**tickit**(7)](/tickit/7.md)
