adcantu • PM |
Aug 04, 2011 10:44 AM
|
![]() Posts: 3 |
Hello I am trying to write a script to parse the top 5 players from my Americas Army server. I am having in issue with special characters.
My top player right now is {FYT}=Backd@@r^STL and it shows up correctly in the gametracker.com server stats page. But in my feed it comes out as %7BFYT%7D%3DBackd%40%40r%5ESTL I noticed the feed is set under the following : <?xml version="1.0" encoding="UTF-8"?> I have read that to get the characters to show properly we need to change it to <?xml version="1.0" encoding="UTF-16"?> Am I correct about this or is something else going on? If so, can this change be made? |
adcantu • PM |
Aug 04, 2011 11:48 AM
|
![]() Posts: 3 |
ok upon further investigation, it creates yet another problem. I want to link the player name to their stats here on gametracker.
so my link looks like this : <a href='http://www.gametracker.com/player/$name/68.232.179.162:1716/' target='_blank'>$name </a> which then turns into this (which works correctly): http://www.gametracker.com/player/%7BFYT%7D=BACKD@@R%5ESTL/68.232.179.162:1716/ but if I were to make the link the same way, using the correct characters, it would look like this (which does not work) : http://www.gametracker.com/player/{FYT}=BACKD@@R^STL/68.232.179.162:1716/
Last edited by: adcantu Aug 04, 2011 7:50 PM
|
burn • PM |
Aug 04, 2011 12:28 PM
|
![]() Posts: 10924 |
Can you use something like htmlspecialchars_decode (php) to switch it?
![]() |
adcantu • PM |
Aug 04, 2011 7:53 PM
|
![]() Posts: 3 |
thanks for the quick reply! I was unable to get that function to work, however it seems that echo rawurldecode(); works well for this.
so now my code looks like echo "<a href='http://www.gametracker.com/player/$name/68.232.179.162:1716/' target='_blank' class='player_rank'>"; echo rawurldecode($name); echo"</a>"; thanks for the help and for the push in the right direction |
burn • PM |
Aug 05, 2011 1:29 AM
|
![]() Posts: 10924 |
Try doing something like
$name2 = urldecode($name); echo "<a href='http://www.gametracker.com/player/".$name2."/68.232.179.162:1716/' target='_blank' class='player_rank'>".$name2."</a>"; it worked for me ![]() |