---
name: "tickit_utf8_mbswidth"
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_mbswidth"
---

# tickit\_utf8\_mbswidth(3)

count the column width of a Unicode string

## NAME

tickit\_utf8\_mbswidth, tickit\_utf8\_byte2col, tickit\_utf8\_col2byte - count the column width of a Unicode string

## SYNOPSIS

```
#include <tickit.h>

int tickit_utf8_mbswidth(const char *str);

int tickit_utf8_byte2col(const char *str, size_t byte);
size_t tickit_utf8_col2byte(const char *str, int col );
```

Link with *-ltickit*.

## DESCRIPTION

These functions are a set of shortcut wrappers around [**tickit\_utf8\_count**(3)](/tickit_utf8_count/3.md) for performing a single simple counting operation on a given string. When performing multiple operations on a given string, it is more efficient to use **tickit\_utf8\_count**() directly.

**tickit\_utf8\_mbswidth**() returns the number of columns wide the given Unicode string consumes.

**tickit\_utf8\_byte2col**() and **tickit\_utf8\_col2byte**() convert between byte and column indexes within a given string; returning one when given the other.

## RETURN VALUE

**tickit\_utf8\_mbswidth**() and **tickit\_utf8\_byte2col**() return an integer column count. **tickit\_utf8\_col2byte**() returns an integer byte count.

## SEE ALSO

[**tickit\_utf8\_count**(3)](/tickit_utf8_count/3.md), [**tickit**(7)](/tickit/7.md)
