I was looking for ways to convert unicode codepoints to utf8.
So far, I've learned I can do it manually or use iconv.
I also thought wctomb would work, but it doesn't:
#define CENTER_UTF8 "\xf0\x9d\x8c\x86"
#define CENTER_UNICODE 0x1D306
int main(int argc, char** argv)
static char buf;
#define WCTOMB(What) \
//Either one fails with -1
You should change program locale properly before using of
#include <locale.h> /* ... */ setlocale(LC_ALL, "");
This sets up program locale setting according to your environment. man setlocale
If locale is an empty string, "", each part of the locale that should be modified is set according to the environment variables.
LC_CTYPE is enough for