c++ - PDcurses 显示问号代替预期字符

标签 c++ curses 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

最佳答案

我回来后解决了这个问题。原来我使用了错误版本的 PDcurses。从可用的 http://sourceforge.net/projects/pdcurses/files/pdcurses/3.4/我正在使用 pdc34dllw。我切换到 pdc34dll,现在它运行良好。

关于c++ - PDcurses 显示问号代替预期字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4358387/

相关文章:

c++ - 以编程方式告诉 PDCurses 使窗口与物理屏幕大小相同的方法?

c++ - 使用 MingW 编译的程序如何使用 Windows 便携设备 (WPD) API?

c++ - 数组类型在函数调用中用作引用类型参数

c++ - 为什么颜色不适用于 stdscr? (PD诅咒)

c - 删除已在 ncurses 终端中打印的字符

c++ - 如何为我的 curses 应用程序关闭或忽略按键重复?

c++ - 如何从 `std::istream` 加载 XML 文档?

c++ - boost::asio 写入大尺寸时挂起

c++ - 清除 ncurses 中的字段缓冲区