nowox
nowox

Reputation: 29178

How to print UTF-8 chars in ncurses?

Traditionally I can perfectly print this:

char str[] = "▄█▀█████";
printf(str); 

However, under ncurses I cannot print this string neither with:

mvprintw(0, 0, str);

nor with:

mvaddwstr(0,0, L"▄█▀█████");

What's my mistake?

Upvotes: 1

Views: 1325

Answers (1)

nowox
nowox

Reputation: 29178

Whooh, this was quick... I already solved it; dear nowox:

You forgot to configure your locales:

#include <locale.h>

setlocale(LC_ALL, "");

Upvotes: 2

Related Questions