I am doing an exercise where I need to write Unicode on the terminal,
using only write() in <unistd.h>.
I can't use :
- putchar
 - setlocale
 - printf (in fact the exercise is reproducing 
printffunction) 
Any "low level" advice on how to perform that?
I am doing an exercise where I need to write Unicode on the terminal,
using only write() in <unistd.h>.
I can't use :
printf function)Any "low level" advice on how to perform that?
As Chris wrote in the comments, you need a terminal (e.g. like xterm on Linux) that understands the Unicode and then you just write them. So by default xterm understands UTF8 and is set to a codepage such that this code will give you a UTF8 Smiley Face (☺).
#include <stdio.h>
#include <unistd.h>
char happy[] = { 0xe2, 0x98, 0xba };  /* U+263A */
int main()
{
   write(1, happy, 3);
   return 0;
}