PDcurses显示问号代替预期的字符 [英] PDcurses displaying question marks in place of intended character
问题描述
我有一个问题,PDcurses显示一些符号?而不是正确的字符。我做了一个小测试程序来显示代码页437,以确定哪些符号是工作和哪些wasnt。
奇怪的是,当我关闭PDcurses的问题符号显示正确。 / p>
问题符号是
这是不含PDcurses的源代码:
#includestdafx.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<< \\\
;
}
// refresh();
// getch();
// endwin();
return 0;
}
这是带有PDcurses的源代码:
#includestdafx.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<< \\\
;
}
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,现在它的工作完美。
Ive got a problem with PDcurses displaying some symbols as ? instead of the proper character. I made a little test program to display code page 437 to determine which symbols were working and which werent.
Strangely, when I turned off PDcurses the problem symbols displayed correctly.
The problem symbols are ÇéâäàåçêëèïîÄæÆôöòûùÿÖÜ¢£₧ƒ
This is the source code without 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;
}
This is the sourcecode with 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;
}
Im running Windows XP service pack 3 and using Microsoft Visual C++ 2010 Express
I came back and solved this one after a while. Turns out I was using the wrong version of PDcurses. From the ones available http://sourceforge.net/projects/pdcurses/files/pdcurses/3.4/ I was using pdc34dllw. I switched to pdc34dll and now it works perfectly.
这篇关于PDcurses显示问号代替预期的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!