Webserver - encoding Problem

I use an ArduinoMega2560 with EthernetShield.

I dont know the right encoding for my index.htm.

I tryed utf8, utf2, ANSI...

void bearbeiteServerAnfragen ()
{
  //Erstelle einen Ethernetclient und warte auf Anfragen
  EthernetClient client = server.available();

  if(client)
  {  

    TextFinder finder(client);
    char file[6];

    finder.getString("GET /",".",file,5);  
    file[5] = 0;
    Serial.println(file);
    if(strcmp(file, "data")==0)
    {    
      verarbeiteDatenAnfrage(client);
      Serial.println("Antworte auf Datenanfrage.");
    }
    else if(strcmp(file, "inde")==0)
    {
      verarbeiteSeitenAnfrage(client);
      Serial.println("Antworte auf Seitenanfrage.");
    }      

    delay(1);
    client.stop();
  }
  else{
    // Serial.println("Ethernetclient konnte nicht erstellt werden.");
  }
}

An other simple htm without Javascript works fine.

index.htm (314 KB)

This is not an encoding problem but an HTML understanding problem. Within an HTML file you cannot use '<' and '>' without escaping them, except they are used for tags. You can circumvent this if you put the javascript code inside comments:

<script type="text/javascript">
// <!--    comment just to hide from parser
// here comes your javascript code
// end comment -->
</script>

this part i had delete completely to show easier... :wink:

So post again and don't "show easier" if you want to get some help here.

You can try to replace all occurrences of ">" by ">" and "<" by "<". If you haven't done the stuff from my previous post correctly, this might help.