/* -*- coding: utf-8 -*- */ #define _XOPEN_SOURCE_EXTENDED #include #include #include #include #include int main (int argc, char ** argv) { cchar_t cch_out, cch1; setlocale (LC_ALL, ""); initscr (); clear (); mvaddwstr (0, 0, L"This is a string"); setcchar(&cch_out, L"˙", 0, 0, 0); /* string contains U+02D9 */ //setcchar(&cch_out, L".", 0, 0, 0); /* string contains U+002E */ bkgrnd (&cch_out); mvaddwstr (1, 0, L"This is another string"); refresh (); sleep (2); endwin (); #if 0 { wchar_t wstr[6]; attr_t attr; short color; /* Get the letter between "This" and "is" in the above sentence. */ mvin_wch (0, 4, &cch1); getcchar(&cch_out, wstr, &attr, &color, NULL); printf ("wchar printed U+%04x\n", wstr[0]); getcchar(&cch1, wstr, &attr, &color, NULL); printf ("wchar read U+%04x\n", wstr[0]); } #endif return 0; }