I know this is not realy about Irrlicht - but somehow it's connected because Irrlicht works on wchar_t types. And that couses my problems
I try to put text into structure like this:
struct Question
{
wchar_t question[1024];
wchar_t answer1[1024];
wchar_t answer2[1024];
...
};
from text file. It's done like this: (already have Question question[100] struct)
char buffer[1024];
int i =0;
ifstream questionfile ("questions.txt");
while (!questionfile.eof())
{
questionfile.getline (buffer, 100);
sprintf(question.question, 1024, L"Question: %s", buffer);
cout<<buffer<<endl;
...
i++;
}
I mean - this is simple code but I'm not very familiar with wchar_t because it doesnt work
I checked and rechecked questions.txt file, even removed it and created again (under windows, before that I had file created under linux). As I remember i worked under Linux.
On this computer I have winXP pro.
Part of code cout<<buffer<<endl; shows text properly on the console.
?? What am I doing wrong ??
wchar_t from char conversion problem
oh, I forgot to mention what the problem is, after all
of course, any text taken from text file is not displayed properly in GUI.
Instead I can see... eh, something with very wrong codepage (like trying to display korean utf16 text as ascii iso-8859-2 for example).
please, at least post some links with desent documentation about wchar_t (humanum no-grande-expertum readable;) )
of course, any text taken from text file is not displayed properly in GUI.
Instead I can see... eh, something with very wrong codepage (like trying to display korean utf16 text as ascii iso-8859-2 for example).
please, at least post some links with desent documentation about wchar_t (humanum no-grande-expertum readable;) )
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
ehhh, of course I used swprintf originaly - this was just a typing error in my post. So problem remain - but I'm closer to solve it by my self.
Btw. I am VERY confused about swprintf function and it's different mutations.
When I jumped to dev-CPP from Kdevelop, compiler seems to understand and compile what I already have done, but in new added files/classes it only "understand" some non standard (m$?) form (without second int argument). That is probably again my fault of misunderstanding or lack of knowledge, but this time it really looks like compiler is a woman - and can't make her mind what to compile or not.
Btw. I am VERY confused about swprintf function and it's different mutations.
When I jumped to dev-CPP from Kdevelop, compiler seems to understand and compile what I already have done, but in new added files/classes it only "understand" some non standard (m$?) form (without second int argument). That is probably again my fault of misunderstanding or lack of knowledge, but this time it really looks like compiler is a woman - and can't make her mind what to compile or not.