How to make ncurses display UTF-8 chars correctly in C?

后端 未结 2 1689
無奈伤痛
無奈伤痛 2020-12-02 01:56

I have a program written in C using ncurses. It let user input and display it. It does not display correctly if user input utf8 chars.

I saved the chars user inputed

2条回答
  •  隐瞒了意图╮
    2020-12-02 02:18

    #need these as well on top of installation and locate setting
    #at least check locale
    locale
    
    locale-gen en_US.UTF-8
    #vim ~/.bashrc # add 3 lines once ok and fix the profile
    export LANG=en_US.UTF-8
    export LANGUAGE=en_US.UTF-8
    export NCURSES_NO_UTF8_ACS=1
    

提交回复
热议问题