Page 1 of 1

'\r' bug with xml reading & render

Posted: Sat May 15, 2004 6:55 am
by Razed
If text is read in using the xml reader and then rendered (via the gui), newline '\r' symbols show up as boxes at the end of each line. The xml file could strip these out, or alternatively the rendering could ignore '\r's.

I'm using SciTE to edit my xml files (in widestring format), so it could be classed as a problem with that editor (as it generates newlines as \r\n).

Posted: Sat May 15, 2004 8:00 am
by niko
I saw this, that's really bad, sorry. :) The xml reader needs still some work.

Posted: Sun May 16, 2004 7:25 am
by Razed
No sweat, Irrlicht's still the best out there - the xml, zip & gui support are great.

Posted: Sun May 16, 2004 8:33 am
by keless
im all about tinyXML

easy to learn, use and integrate into any project (including irrlicht), and it doesnt have any problems. I use it in IrrlichtRPG (and ICE in general).

Posted: Mon May 24, 2004 9:41 am
by Razed
Its nice having xml as part of the engine, especially since its bundled over the zip reader.

Actually I'll slip another feature request in here. Having int/float functions that return a bool of success would be good, as in:
bool getAttributeValue(int& value, const wchar_t* name)
bool getAttributeValue(float& value, const wchar_t* name)

I prefer the above format due to function overloading (better clarity), as well as the ability to test whether the value was found or not.

Posted: Wed Aug 09, 2006 1:56 am
by jolindien
Thx to this post and because I also had those "black boxes" in GUI elements at the end of sentences read from and xml file, i have fixed it as follow :

in bool CXMLReaderImpl::setText(char_type* start, char_type* end) :

i replaced :

Code: Select all

// set current text to the parsed text, and replace xml special characters
		core::string<char_type> s(start, (int)(end - start));
		NodeName = replaceSpecialCharacters(s);
by :

Code: Select all

// set current text to the parsed text, and replace xml special characters
		core::string<char_type> s(start, (int)(end - start));
		s.replace('\r',' ');
		NodeName = replaceSpecialCharacters(s);
A bit of an axe fix, but well, it seems to work... what about this bug/fix ?