开发者

PDcurses displaying question marks in place of intended character

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();
    r开发者_如何学编程eturn 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜