NationData feed b0rked, unable to process special characters
Peng-Pau
30-11-2003, 20:09
The nationdata feed returns this when I view someone who has non-standard characters in their motto.
Example:
XML Parsing Error: undefined entity
Location: http://www.nationstates.net/cgi-bin/nationdata.cgi/nation=nuMetal
Line Number 8, Column 8:
[code:1:801749dbb8]<MOTTO>&Let us instigate the revolt!Down with the system!SOAD&</MOTTO>
-------^[/code:1:801749dbb8]
Any ideas on whether or not this is fixable, and if so, an ETA?
Goobergunchia
30-11-2003, 20:10
The mark in question: ¤
Peng-Pau
30-11-2003, 20:11
The mark in question: ¤
Heh.
For some reason I thought this had been fixed
ah well, now no spies can use my XML feed against me :o
What spies you ask?
...
Well I'm not sure, but the paranoid part of my brain assures me that there are spies
Edit:
and the history of the lovley '¤'
You see, there was a thread, I think in moderation, about allowing people to talk in binary if they wanted, somebody posted a link to a binary translator, Sirocco went to it, typed in a bunch of random '1's and '0's and got back a bunch of random characters, and I think the conclusion is obvious
Athamasha
30-11-2003, 20:26
I think those are "universal currency symbols."
I think those are "universal currency symbols."
In that case, the choice wasn't random, and is actually a subtle satire at corporate capitalism :wink:
SalusaSecondus
30-11-2003, 21:11
Two things. I've actually looked into this one for a while (as one of my puppets has a special character in the motto) and think that I have narrowed this one down.
Peng Pau, do you use a Mozilla browser (and that includes Netscape, etc.)? If you look at the source, you will find that the XML is fine, it is just being parsed incorrectly.
And second, yes, I believe that it is the universal currency symbol.
http://www.weirdozone.0catch.com/projects/nationstates/salusasecondus/salusasecondus2.jpg
SalusaSecondus
Tech Modling
Peng-Pau
30-11-2003, 21:15
Two things. I've actually looked into this one for a while (as one of my puppets has a special character in the motto) and think that I have narrowed this one down.
Peng Pau, do you use a Mozilla browser (and that includes Netscape, etc.)? If you look at the source, you will find that the XML is fine, it is just being parsed incorrectly.
And second, yes, I believe that it is the universal currency symbol.
http://www.weirdozone.0catch.com/projects/nationstates/salusasecondus/salusasecondus2.jpg
SalusaSecondus
Tech Modling
Heh, yes, I use Firebird 0.7...
So it's a client issue, not a server issue?
So why does this affect my script? (Borked Example (http://www.vinari.co.uk/ns/mmc.php?mode=post&nation=NuMetal) Working Example (http://www.vinari.co.uk/ns/mmc.php?mode=post&nation=Peng-Pau&space=on))
Two things. I've actually looked into this one for a while (as one of my puppets has a special character in the motto) and think that I have narrowed this one down.
Peng Pau, do you use a Mozilla browser (and that includes Netscape, etc.)? If you look at the source, you will find that the XML is fine, it is just being parsed incorrectly.
And second, yes, I believe that it is the universal currency symbol.
http://www.weirdozone.0catch.com/projects/nationstates/salusasecondus/salusasecondus2.jpg
SalusaSecondus
Tech Modling
Heh, yes, I use Firebird 0.7...
So it's a client issue, not a server issue?
So why does this affect my script? (Borked Example (http://www.vinari.co.uk/ns/mmc.php?mode=post&nation=NuMetal) Working Example (http://www.vinari.co.uk/ns/mmc.php?mode=post&nation=Peng-Pau&space=on))
In IE I get:
[code:1:3a595ff4dc]The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Reference to undefined entity 'curren'. Error processing resource 'http://www.nationstates.net/cgi-bin/nationdata.cgi/nation=numetal'. Line 8, Position 9
<MOTTO>&Let us instigate the revolt!Down with the system!SOAD&</MOTTO>
--------^
[/code:1:3a595ff4dc]
Goobergunchia
30-11-2003, 21:29
<---- confirms Nu's report
Have you tried using the PHP string function addslashes to escape these?
Peng-Pau
01-12-2003, 02:36
Have you tried using the PHP string function addslashes to escape these?
Well, I get the problem viewing the actual nationdata.cgi page for NuMetal, so I don't think it's my script...
SalusaSecondus
01-12-2003, 07:14
Hmm, ok, I'll poke around a bit more.
[violet]
02-12-2003, 11:16
Okay, I think I've fixed this -- at least for non-standard characters in the national motto. Let me know if you spot any other problems.
Peng-Pau
03-12-2003, 19:22
Yay, ok, that one works, but it still hates '&'...
XML Parsing Error: not well-formed
Location: http://www.nationstates.net/cgi-bin/nationdata.cgi/nation=Battlecrabs
Line Number 8, Column 20:
[code:1:49eb1de9f9]<MOTTO>Aggression & Expansion: the watchword of the destroyer </MOTTO>
-------------------^[/code:1:49eb1de9f9]