ncurses chgat function messes up line graphics/acs characters

Solution 1:

I did same bug. You lost an attribute A_ALTCHARSET. Special characters are some "normal" characters with attribute A_ALTCHARSET. When you masc this attribute (or if you do reset of this flag), then you see normal chars. You need to read original attribute, and if it uses A_ALTCHARSET you need it set again:

                if (mvwinch(menu->shadow_window, i, j) & A_ALTCHARSET)
                    mvwchgat(menu->shadow_window, i, j, 1,
                                shadow_attr | A_ALTCHARSET,
                                config->menu_shadow_cpn,
                                NULL);
                else
                    mvwchgat(menu->shadow_window, i, j, 1,
                                shadow_attr,
                                config->menu_shadow_cpn,
                                NULL);