PDcurses 在预期字符处显示问号
我遇到了 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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一段时间后我回来解决了这个问题。原来我使用了错误版本的 PDcurses。从可用的 http://sourceforge.net/projects/pdcurses/files/pdcurses/ 3.4/ 我使用的是pdc34dllw。我切换到 pdc34dll,现在它工作得很好。
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.
在第二个示例中,当您将 c 设为 char 而不是 int 时会发生什么?
What happens when you make c a char instead of int in your second example?