the xml reader seqfaults on linux with gcc-3.3.3 and maybe others
i am not sure why, maybe wchar_t isnt 16 bit anymore, but the
header of the textfile doesnt show up as 0xfffe or 0xfeff but as 0x3cfffe
you can fix it, changin line #80 (void CTextReader::convertToUTF16())
of CTextReader.cpp from
(header[0] == 0xFFFE || header[0] == 0xFEFF))
to
((header[0]&0xffff) == 0xFFFE || (header[0]&0xffff) == 0xFEFF))
btw:
thanx for irrlicht. this is the easiest api for a 3d engine ever seen, and
i have seen a lot, including commercial.
i am looking forward to see a big endian able version... i could offer my
help in porting if needed (also i have a veeery slow ppc machine, which
is not really fun to code c++ with )
xmlreader segfault on linux gcc-3.3.3 + fix
Re: xmlreader segfault on linux gcc-3.3.3 + fix
AFAIK it is 32 bit under most Unixes.G.o.D wrote:the xml reader seqfaults on linux with gcc-3.3.3 and maybe others
i am not sure why, maybe wchar_t isnt 16 bit anymore,
Thanx for the fix!but the header of the textfile doesnt show up as 0xfffe or 0xfeff but as 0x3cfffe
you can fix it, changin line #80 (void CTextReader::convertToUTF16())
of CTextReader.cpp from
(header[0] == 0xFFFE || header[0] == 0xFEFF))
to
((header[0]&0xffff) == 0xFFFE || (header[0]&0xffff) == 0xFEFF))
There were already some people working on this, please search the forums. (I forgot where, when or who :)i am looking forward to see a big endian able version... i could offer my
help in porting if needed (also i have a veeery slow ppc machine, which
is not really fun to code c++ with :) )
Tels
Perl + Irrlicht + Audiere = Game: http://bloodgate.com/perl/game
update: fix was not complete
sorry, i didnt notice that this was only preventing the segfault, but the data of the xml file was completely ignored... so here is a fix, applyable with patch which finally makes the xml file reader reading the data (which i thought might be a good idea )
Code: Select all
--- orig.source/CTextReader.cpp 2004-03-04 16:25:36.000000000 +0100
+++ source/CTextReader.cpp 2004-03-14 09:52:53.000000000 +0100
@@ -77,14 +77,20 @@
wchar_t* header = (wchar_t*)CData;
if (CDataSize>=2 &&
- (header[0] == 0xFFFE || header[0] == 0xFEFF))
+ ((header[0]&0xffff) == 0xFFFE || (header[0]&0xffff) == 0xFEFF))
{
// We've got UTF-16
- TextData = &header[1];
+ TextData=new wchar_t[CDataSize];
+ for (u32 i=2; i<CDataSize; ++i) {
+ TextData[i]=(wchar_t)(CData[i*2+1]<<8)|CData[i*2];
+ }
+ delete [] CData;
+ CData = (c8*)TextData;
+
TextDataSize = (CDataSize - 1) / (sizeof(wchar_t) / sizeof(c8)); // header
- if (header[0] == 0xFFFE)
+ if ((header[0]&0xffff) == 0xFFFE)
{
// This is Big Endian,
// convert to little endian.
yeah, i did it once again... the patch does not work correctly
so i now uploaded a final version which now works and is even tested this time...
here it is:
patch
you can call me microsoft
so i now uploaded a final version which now works and is even tested this time...
here it is:
patch
you can call me microsoft