Vultr.com - Instant Cloud Server Deployment
GAMETRACKER FORUMS
Forum Home > General Help > Feeds - Encoding
adcantuPM
#1
Feeds - Encoding
Aug 04, 2011 10:44 AM
Joined: Sep 15, 2009
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?
adcantuPM
#2
Aug 04, 2011 11:48 AM
Joined: Sep 15, 2009
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
burnPM
#3
Aug 04, 2011 12:28 PM
Joined: Sep 27, 2006
Posts: 10924
Can you use something like htmlspecialchars_decode (php) to switch it?
I am retired from GameTracker after 11 years and will not be responsive for support requests.

adcantuPM
#4
Aug 04, 2011 7:53 PM
Joined: Sep 15, 2009
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
burnPM
#5
Aug 05, 2011 1:29 AM
Joined: Sep 27, 2006
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
I am retired from GameTracker after 11 years and will not be responsive for support requests.