GOA:s XML-encoding

S

Seyrcim

Guest
(This post regards PHP)
I see a lot of ppl have the same problem as me with this ;) In the XML it states it usues UTF-8, but even if I create my parser like this:
$xml_parser = xml_parser_create("UTF-8");

and use the translation table some chars get fooked up (sort of each nations ÅÄÖ etc) I haven't identifed all yet, as I haven't seen all occurances yet. I made my own translation-table tho:
$trans = array('ä' => 'ä',
'é' => 'é',
'ë' => 'ë',
'ö' => 'ö',
'ü' => 'ü',

I wouldn't mind the list completely filled, or even better, to get rid of it and know if I just messed up in my coding.

Depending on how long they keep their claim, here's an example of what I mean http://norseman.cjb.net/main.php?page=realm&server=Lyonesse (Hüter von Tara shows up as Hüter von Tara)
 
E

exc_hib_boo

Guest
The encoding is bad and is breaking the rules of XML.

You need to replace the 'weird' chars with their numerical enitites, examples:

Å: & # 197 ;
Ä: & # 196 ;
Ö: & # 246 ;

(Remove the spaces)

The only time you can write these chars within an XML file is in a CDATA-section, which they don't use. (Don't think you could use that for an attribute anyhow, so some things would still be messed up)

Hope it helps
 
S

Seyrcim

Guest
Well, I actually used the numbers before, but as you see the chars doesn't match ONE numer, it's made up of two bytes. So that doesn't work either =/
 
E

Eblessair

Guest
Code:
			$guild_name =~ s/& # 38;/&/;
			$guild_name =~ s/'/'/;
			$guild_name =~ s/ö/ö/;
			$guild_name =~ s/\+©/ø/;
			$guild_name =~ s/Æ/Æ/;
			$guild_name =~ s/ñ/ñ/;
			$guild_name =~ s/ø/ø/;
			$guild_name =~ s/Ã¥/å/;
			$guild_name =~ s/ä/ä/;

remove spaces for the first one ;)
those are all the ones i found, and that are used in the current guilds on excalibur.

however, the last one perl does not like one bit, dies saying its an unrecognised chr :(

hope this helps
 
S

Seyrcim

Guest
I will make a complete list of all the 'weird' chars when I get home (can't fiddle with it at work you know ;) )

Anyways, so far there are:
Code:
$trans = array('Ó' >= 'Ó', // Ó
               'ð' >= 'ð',    // ð
               'ä' => 'ä',   // ä
               'é' => 'é', // é
               'ë' => 'ë',   // ë
               'ö' => 'ö',   // ö
               'ü' => 'ü');  // ü

and when 'translating' it I do a
Code:
... strtr($keep[$count]["CLAIM"],$trans) ...

Btw, this was how the first post was supposed to look (meant for the html-special-chars to be shown as above) :sleeping:
 
S

Seyrcim

Guest
Ok, here we go: (don't ask me what kind of stuff some ppl put in ther guild names :rolleyes: )

Code:
$trans = array('Ó' => 'Ó',  // Ó
               'ð' => 'ð',     // ð
               'ä' => 'ä',    // ä
               'é' => 'é',  // é
               'ë' => 'ë',    // ë
               'ö' => 'ö',    // ö
               'ü' => 'ü',    // ü
               'ø' => 'ø',  // ø
               '´' => '´',   // ´
               'Æ' => 'Æ',   // Æ
               'ñ' => 'ñ',  // ñ
               'Ã¥' => 'å',   // å
               'Ä' => 'Ä',    // Ä
               'ê' => 'ê',   // ê
               'è' => 'è',  // è
               'ï' => 'ï',    // ï
               'ô' => 'ô',   // ô
               'û' => 'û',   // û
               'â' => 'â',   // â
               'á' => 'á',  // á
               'Ã' => 'Á',  // Á
               'Ã' => 'Ð',     // Ð
               'ò' => 'ò',  // ò
               'ß' => 'ß',   // ß
               'ú' => 'ú',  // ú
               'ý' => 'ý',  // ý
               'ó' => 'ó',  // ó
               'Ö' => 'Ö',    // Ö
               'Ã_' => 'í',  // í
               '†' => '?',         // ?
               'ç' => 'ç',  // ç
               'î' => 'î',   // î
               'Ã'  => 'á'); // á

(maybe should change it to chr-values, but I am not really up to it, anyone ? =)
 

Users who are viewing this thread

Top Bottom