---
name: "kiconv"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/kiconv"
---

# kiconv(3)

kernel side iconv library

## NAME

**kiconv\_add\_xlat16\_cspair**, **kiconv\_add\_xlat16\_cspairs**, **kiconv\_add\_xlat16\_table** – kernel side iconv library

## LIBRARY

library “libkiconv”

## SYNOPSIS

**#include \<sys/iconv.h\>**

*int*\

**kiconv\_add\_xlat16\_cspair**(*const char \*tocode*, *const char \*fromcode*, *int flag*);

*int*\

**kiconv\_add\_xlat16\_cspairs**(*const char \*foreigncode*, *const char \*localcode*);

*int*\

**kiconv\_add\_xlat16\_table**(*const char \*tocode*, *const char \*fromcode*, *const void \*data*, *int datalen*);

## DESCRIPTION

The **kiconv** library provides multi-byte character conversion tables for kernel side iconv service.

The **kiconv\_add\_xlat16\_cspair**() function defines a conversion table using [iconv(3)](/iconv/3.md) between *fromcode* charset and *tocode* charset. You can specify *flag* to determine if [tolower(3)](/tolower/3.md) / [toupper(3)](/toupper/3.md) conversion is included in the table. The *flag* has following values.

- KICONV\_LOWER

  - KICONV\_FROM\_LOWER

  It generates a tolower table in addition to a character conversion table. The difference between two is tolower *tocode* or tolower *fromcode*.

- KICONV\_UPPER

  - KICONV\_FROM\_UPPER

  It generates a toupper table in addition to a character conversion table. The difference between two is toupper *tocode* or toupper *fromcode*.

A tolower/toupper conversion is limited to single-byte characters.

The **kiconv\_add\_xlat16\_cspairs**() function defines two conversion tables which are from *localcode* to *foreigncode* and from *foreigncode* to *localcode*. These conversion tables also contain both tolower and toupper tables.

The **kiconv\_add\_xlat16\_table**() function defines a conversion table directly pointed by *data* whose length is *datalen*, not using [iconv(3)](/iconv/3.md).

## SEE ALSO

[iconv(3)](/iconv/3.md), [tolower(3)](/tolower/3.md), [toupper(3)](/toupper/3.md)
