tickit_utf8_col2byte(3)

tickit_utf8_col2byte3

Count the column width of a unicode string

Part of tickit_utf8_mbswidth(3).

Usage

#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.

Overview

These functions are a set of shortcut wrappers around tickit_utf8_count(3) 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.

Releases

Unchanged in 4 releases since Debian 10 (Buster).

  1. 10–13

From libtickit-dev 0.4.3-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.