我是否遇到PDcurses顯示某些符號的問題?而不是適當的字符。我做了一個測試程序來顯示代碼頁437,以確定哪些符號正在工作以及哪些符號正常工作。PDcurses顯示問號以代替預期的字符
奇怪的是,當我關閉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
當我這樣做時,一半的人物出現灰色塊。我通過使用int而不是char來解決這個問題。 – Diabl0658 2010-12-05 22:07:08