Special charakters not parsed correct

Sync Blizzards' Armory data with WoWRoster (addon depreciated no longer works see ApiSync)

Moderators: Ulminia, poetter

Special charakters not parsed correct

Postby Hurz » Thu Jun 28, 2007 10:45 pm

I found an bug when I run the sync with the EU-german Armory:

The german word for male is Männlich and it is parsed into the db into roster_players -> sex. If i sync with the Armory, every updated male charakter is saved as with the sex "M�nnlich". If I upload my character, the sex is saved in the db as "Männlich".

The first one (from the sync run) gives a wrong output in the character overview. Instead of "Männlich" there is stands "M[]nnlich", but the second one delivers a correct output "Männlich". Somhow the special character parsing seems to make a misstake here. I am no coder so I have no clue why and where this happens.

PS: in the meantime, everyone can run this SQL statement to change the wrong spelling:

Code: Select all
UPDATE `roster_players` SET `SEX` = 'MännlicH' WHERE `SEX` = 'M�nnlich';
Hurz
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Mon Jun 18, 2007 12:01 am

Re: Special charakters not parsed correct

Postby poetter » Sat Jul 14, 2007 12:31 am

This problem is caused be the armory. If you look at the code there seems to be a codepage problem in the xml file. The problem seems to affect only the fields sex with content 'Männlich' and class with content 'Jäger'.

I have no idea what codepage was uses to encode the ä's. I tried multiple methods, but nothing helped.

You can solve the problem in changing the code in functions.parsing.php to

Code: Select all
   $player["Class"] = $attribs->character->class;
   if ( substr($player["Class"] ,0,1) == 'J' && substr($player["Class"] ,-3) == 'ger' ) {
      $player["Class"] = utf8_encode('Jäger');
   }
   $player["Health"] = $attribs->characterTab->characterBars->health->effective;
   $player["Mana"] = $attribs->characterTab->characterBars->secondBar->effective;
   $player["Sex"] = $attribs->character->gender;
   if ( $player["Sex"] != 'Weiblich' ) {
      $player["Sex"] = utf8_encode('Männlich');
   }


I know it is very ugly, but as long i don't know the codepage this is the only way.
Last edited by poetter on Sat Jul 14, 2007 12:34 am, edited 1 time in total.
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg


Return to ArmorySync - Depreciated

Who is online

Users browsing this forum: No registered users and 1 guest

cron