Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 C 中打印希腊字符?我正在尝试打印出“ΑΝΑΓΡΑΜΜΑΤΙΣΜΟΣ”这个词:
printf("ΑΝΑΓΡΑΜΜΑΤΙΣΜΟΣ");
但我在控制台中得到了一些随机符号作为输出。
将您的控制台字体设置为 Unicode TrueType 字体并使用“ANSI”机制(假设 Windows...)发出数据。例如,此代码打印 γειά σου:
#include "windows.h" int main() { SetConsoleOutputCP(1253); //"ANSI" Greek printf("\xE3\xE5\xE9\xDC \xF3\xEF\xF5"); // encoded as windows-1253 return 0; }