带有 c 字符和重音符号的菜单

问题描述 投票:0回答:1

我的C代码使用特殊字符来创建菜单边框,并且还使用locale.h库让程序接受重音符号,但是随着库和重音符号的使用,菜单边框字符发生变化,是否可以两者兼得?

我尝试寻找另一个重音库,但找不到。

c menu
1个回答
0
投票

你可以尝试做这样的事情,这样它就不会改变:

#include <stdio.h>
#include <locale.h>

int main() {
    
    setlocale(LC_ALL, "en_US.utf8");

    // Code that needs to handle accents here.

    // Go back to default for menu borders.
    setlocale(LC_ALL, "C");

    // Then you display the menu borders.

    return 0;
}
© www.soinside.com 2019 - 2024. All rights reserved.