I have now done these things :

(1) You have danish characters you want to send to your browser via
XML.
This is possible using UTF-8 encoding.
First make sure everyone knows you want to use UTF-8 in your XML
output.
You need something in your PHP like -
    header("Content-Type: text/xml; charset=utf-8");
This will tell the browser what character encoding to expect.


Then to encode the characters from your database, use something in
your PHP code like -
  $address=utf8_encode($address);
to take care of the danish characters.


(2) Something that was pointed out to you ages ago, was the lack of a
header on your XML.
If you ever added it, you took it out again somewhere.
Try validating your XML http://www.micmus.dk/phpsqlajax_genxml.php at
-
   http://www.validome.org/validate
And notice that it fails because of missing doctype.
Notice also that it guesses your character encoding as US-ASCII


You want something like this (called a doctype declaration) at the
top
of your XML file -
echo "<?xml version='1.0' encoding='utf-8'>";
Notice that it tells the browser's XML parser to expect UTF-8
encoding.


But still it fails :-(  here : http://www.micmus.dk/new_phpsqlajax_genxml.php



On 28 Sep., 03:31, Rossko <[EMAIL PROTECTED]> wrote:
> > But what can i do about it ??
>
> Go back a step and work out what you're trying to.
>
> (1) You have danish characters you want to send to your browser via
> XML.
> This is possible using UTF-8 encoding.
> First make sure everyone knows you want to use UTF-8 in your XML
> output.
> You need something in your PHP like -
>     header("Content-Type: text/xml; charset=utf-8");
> This will tell the browser what character encoding to expect.
>
> Then to encode the characters from your database, use something in
> your PHP code like -
>   $address=utf8_encode($address);
> to take care of the danish characters.
>
> (2) Something that was pointed out to you ages ago, was the lack of a
> header on your XML.
> If you ever added it, you took it out again somewhere.
> Try validating your XMLhttp://www.micmus.dk/phpsqlajax_genxml.phpat
> -
>    http://www.validome.org/validate
> And notice that it fails because of missing doctype.
> Notice also that it guesses your character encoding as US-ASCII
>
> You want something like this (called a doctype declaration) at the top
> of your XML file -
> echo "<?xml version='1.0' encoding='utf-8'>";
> Notice that it tells the browser's XML parser to expect UTF-8
> encoding.
>
> -------------
> Get that working properly before you move on to the next step
> --------------
>
> (2)  As completely seperate business, you want to include HTML in your
> XML data.
> This is possible using 'entity encoding', so that & < > and so on
> aren't misunderstood by the XML parser in the browser.
> You want something in your PHP code like -
> $address=htmlentities($address, ENT_QUOTES);
> which will produce &amp; &lt; &gt; &apos; and so on.
> This will pass through XML without upsetting the parser, but when
> rendered on-screen the browser should turn them back into & < > etc.
>
> You'll want to do that after the UTF-8 encoding.
>
> good luck, Ross K
>
>
>
>
>
> > On 27 Sep., 22:37, Rossko <[EMAIL PROTECTED]> wrote:
>
> > > > <IMG  class=IMG1 SRC=arrows_trans.gif> <a href="http://www.micmus.dk/
> > > > udvidsoeg.php?map=map&maal=Østrig&afr=1215813600&hjem=1226703600"
> > > > class=link15>Se Crab Pot ø æ å</a>
>
> > > Your <IMG> tag is broken - no quotemarks ??
>
> > > cheers, Ross K- Hide quoted text -
>
> > - Show quoted text -- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to