PDcurses 将某些符号显示为 ?而不是正确的字符。我制作了一个小测试程序来显示代码页 437,以确定哪些符号有效,哪些无效。
奇怪的是,当我关闭 PDcurses 时问题符号显示正确。
问题符号是 ÇéâäàåçêëèïîÄæÆôöòûùÿÖÜ¢£₧ƒ
这是没有 PDcurses 的源代码:
#include "stdafx.h"
#include <curses.h>
#include <iostream>
#include <panel.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
//initscr();
char c;
for (int a = 0; a < 16; a++)
{
for (int b = 1; b < 17; b++)
{
move(a, b - 1);
c = b + (a * 16) - 1;
//addrawch(c);
cout << c;
}
cout << "\n";
}
//refresh();
//getch();
//endwin();
return 0;
}
这是 PDcurses 的源代码:
#include "stdafx.h"
#include <curses.h>
#include <iostream>
#include <panel.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
initscr();
int c;
for (int a = 0; a < 16; a++)
{
for (int b = 1; b < 17; b++)
{
move(a, b - 1);
c = b + (a * 16) - 1;
addrawch(c);
//cout << c;
}
//cout << "\n";
}
refresh();
getch();
endwin();
return 0;
}
我正在运行 Windows XP Service Pack 3 并使用 Microsoft Visual C++ 2010 Express
最佳答案
我回来后解决了这个问题。原来我使用了错误版本的 PDcurses。从可用的 http://sourceforge.net/projects/pdcurses/files/pdcurses/3.4/我正在使用 pdc34dllw。我切换到 pdc34dll,现在它运行良好。
关于c++ - PDcurses 显示问号代替预期字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4358387/