UNICODE::ICONVERT::C(3)
β¨ UNICODE::ICONVERT::C(3) β¨
okay so bestie, welcome to the Courier Unicode Library corner of the manual pages π this one is unicode::iconvert::convert, plus a lil squad of charset constants: unicode::ucs_4, unicode::ucs_2, unicode::utf_8, and unicode::iso_8859_1 π¦ the whole vibe is unicode character set conversion, and honestly? it's giving essential.
πΈ NAME πΈ
unicode::iconvert::convert, unicode::ucs_4, unicode::ucs_2, unicode::utf_8, unicode::iso_8859_1 β unicode character set conversion π
π SYNOPSIS π
#include <courier-unicode.h>
extern const char unicode::ucs_4[];
extern const char unicode::ucs_2[];
extern const char unicode::utf_8[];
extern const char unicode::iso_8859_1[];
std::string unicode::iconvert::convert(const std::string_view &text,
const std::string &srccharset,
const std::string &dstcharset);
std::string unicode::iconvert::convert(const std::string_view &text,
const std::string &srccharset,
const std::string &dstcharset,
bool &errflag);
std::string unicode::iconvert::convert(const std::u32string_view &text,
const std::string &dstcharset);
std::string unicode::iconvert::convert(const std::u32string_view &text,
const std::string &dstcharset,
bool &errflag);
bool unicode::iconvert::convert(const std::string_view &text,
const std::string &charset,
std::u32string &text);
π DESCRIPTION π
so the unicode::convert::convert() functions are overloaded (main character energy, obviously π) and here's what they convert:
- a text string going from one supported character set to another one, and you get the brand new string back π«
- a Unicode string turning into a character string in a supported character set π
- or they initialize a Unicode string β passed on in by reference β by converting a text string from a given character set over to unicode π§
these functions are lowkey powered by iconv(3), and they can handle any character set that iconv(3) supports. no cap β¨
use unicode::ucs_2 and unicode::ucs_4 when you wanna specify the 16 and the 32 bit unicode octet in native byte order π and use unicode::utf_8 and unicode::iso_8859_1 to specify these two standard character sets π
now for the flag stuff: the overloaded versions that pass a reference to a bool set that flag to true if some characters could not be converted π and the overloaded version that initializes a unicode vector returns that bool flag instead π periodt.
π SEE ALSO π
courier-unicode(7), unicode::convert::convert_tocase(3), unicode_convert(3), iconv(3). go read them, iykyk π
π AUTHOR π
Sam Varshavchik β Author π«Ά
Courier Unicode Library Β· 04/12/2026 β ok bye bestie, go convert some charsets, you're literally gonna slay π β¨ππ¦π
π¦ where this page comes from
- nixpkgs unstable: courier-unicode 2.6.0
- ubuntu stonking: libcourier-unicode-dev 2.6.0-2ubuntu1 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms