---
name: "Tcl_UniCharToLower"
section: "3"
platform: "linux"
package: "tcl"
version: "8.6.16-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Tcl_UniCharToLower"
---

# Tcl\_UniCharToLower(3)

routines for manipulating the case of Unicode characters and UTF-8 strings

```

```

## NAME

Tcl\_UniCharToUpper, Tcl\_UniCharToLower, Tcl\_UniCharToTitle, Tcl\_UtfToUpper, Tcl\_UtfToLower, Tcl\_UtfToTitle - routines for manipulating the case of Unicode characters and UTF-8 strings

## SYNOPSIS

```
#include <tcl.h>

Tcl_UniChar
Tcl_UniCharToUpper(ch)

Tcl_UniChar
Tcl_UniCharToLower(ch)

Tcl_UniChar
Tcl_UniCharToTitle(ch)

int
Tcl_UtfToUpper(str)

int
Tcl_UtfToLower(str)

int
Tcl_UtfToTitle(str)
```

## ARGUMENTS

- int *ch* (in)

  The Unicode character to be converted.

- char *\*str* (in/out)

  Pointer to UTF-8 string to be converted in place.

  ```

  ```

## DESCRIPTION

The first three routines convert the case of individual Unicode characters:

If *ch* represents a lower-case character, **Tcl\_UniCharToUpper** returns the corresponding upper-case character.  If no upper-case character is defined, it returns the character unchanged.

If *ch* represents an upper-case character, **Tcl\_UniCharToLower** returns the corresponding lower-case character.  If no lower-case character is defined, it returns the character unchanged.

If *ch* represents a lower-case character, **Tcl\_UniCharToTitle** returns the corresponding title-case character.  If no title-case character is defined, it returns the corresponding upper-case character.  If no upper-case character is defined, it returns the character unchanged.  Title-case is defined for a small number of characters that have a different appearance when they are at the beginning of a capitalized word.

The next three routines convert the case of UTF-8 strings in place in memory:

**Tcl\_UtfToUpper** changes every UTF-8 character in *str* to upper-case.  Because changing the case of a character may change its size, the byte offset of each character in the resulting string may differ from its original location.  **Tcl\_UtfToUpper** writes a null byte at the end of the converted string.  **Tcl\_UtfToUpper** returns the new length of the string in bytes.  This new length is guaranteed to be no longer than the original string length.

**Tcl\_UtfToLower** is the same as **Tcl\_UtfToUpper** except it turns each character in the string into its lower-case equivalent.

**Tcl\_UtfToTitle** is the same as **Tcl\_UtfToUpper** except it turns the first character in the string into its title-case equivalent and all following characters into their lower-case equivalents.

## BUGS

At this time, the case conversions are only defined for the Unicode plane 0 characters.  The result for Unicode characters above 0xFFFF is undefined, but - actually - only the lower 16 bits of the character value is handled.

## KEYWORDS

utf, unicode, toupper, tolower, totitle, case
