'\r' bug with xml reading & render

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Razed
Posts: 9
Joined: Mon May 10, 2004 9:43 am

'\r' bug with xml reading & render

Post 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).
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

I saw this, that's really bad, sorry. :) The xml reader needs still some work.
Razed
Posts: 9
Joined: Mon May 10, 2004 9:43 am

Post by Razed »

No sweat, Irrlicht's still the best out there - the xml, zip & gui support are great.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post 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).
a screen cap is worth 0x100000 DWORDS
Razed
Posts: 9
Joined: Mon May 10, 2004 9:43 am

Post 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.
jolindien
Posts: 16
Joined: Sun Jul 16, 2006 3:00 pm
Location: Lyon (France)

Post 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 ?
Post Reply