PDcurses 在预期字符处显示问号

发布于 2024-10-06 06:21:55 字数 1354 浏览 1 评论 0原文

我遇到了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柏拉图鍀咏恒 2024-10-13 06:21:55

一段时间后我回来解决了这个问题。原来我使用了错误版本的 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.

调妓 2024-10-13 06:21:55

在第二个示例中,当您将 c 设为 char 而不是 int 时会发生什么?

What happens when you make c a char instead of int in your second example?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文