Adding Unicode/UTF8 chars to a ncurses display in C

前端 未结 4 378
無奈伤痛
無奈伤痛 2020-12-06 11:09

I\'m attempting to add wchar_t Unicode characters to an ncurses display in C.

I have an array:

wchar_t characters[]={L\'\\uE030\', L\'\\uE029\'}; //          


        
4条回答
  •  佛祖请我去吃肉
    2020-12-06 11:35

    cchar_t is defined as:

    typedef struct {
        attr_t  attr;
        wchar_t chars[CCHARW_MAX];
    } cchar_t;
    

    so you might try:

    int add_wchar(int c)
    {
        cchar_t t = {
            0, // .attr
            {c, 0} // not sure how .chars works, so best guess
        };
        return add_wch(t);
    }
    

    not at all tested, but should work.

提交回复
热议问题