---
name: "unicode::iconvert::convert_tocase"
section: "3"
platform: "linux"
package: "libcourier-unicode-dev"
version: "2.3.2-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/unicode::iconvert::convert_tocase"
---

# unicode::iconvert::convert\_tocase(3)

unicode uppercase, lowercase, and titlecase conversion

## NAME

unicode::iconvert::convert\_tocase - unicode uppercase, lowercase, and titlecase conversion

## SYNOPSIS

```
#include <courier-unicode.h>
```

**std::string unicode::iconvert::convert\_tocase( const std::string &***text***, const std::string &***charset***, char32\_t (\****first\_char\_func***)(char32\_t), char32\_t (\****char\_func***)(char32\_t));**

**std::string unicode::iconvert::convert\_tocase( const std::string &***text***, const std::string &***charset***, bool &***err***, char32\_t (\****first\_char\_func***)(char32\_t), char32\_t (\****char\_func***)(char32\_t));**

## DESCRIPTION

The overloaded **unicode::convert::convert\_tocase**() function converts the *text* parameter, in the *charset* characters to lowercase, uppercase, and titlecase. *text* gets converted, internally, into unicode. *first\_char\_func* and *char\_func* are either: **unicode\_lc**, **unicode\_uc**, or **unicode\_tc**. If the converted text string is not empty, *first\_char\_func* converts the first unicode character in the text string, and *char\_func* converts any remaining characters. **unicode\_lc** converts its character to lowercase, **unicode\_uc** to uppercase, and **unicode\_tc** to titlecase. Finally, the unicode string gets converted back to *charset*, which gets returned.

The optional *err* parameter gets set to true if an error was encounted converting the text string to or from unicode.

## SEE ALSO

[**courier-unicode**(7)](/courier-unicode/7.md), **unicode::convert::convert**(3), [**unicode\_convert**(3)](/unicode_convert/3.md), [**iconv**(3)](/iconv/3.md).

## AUTHOR

**Sam Varshavchik**

Author
