Pete: Umlaute umwandeln

Beitrag lesen

Ich habe jetzt folgendes gefunden und ausprobiert:

http://www.javatop.de/scripte3/umlautkonverter.htm
ist der Beweis das man die Umaute mittels JS umwandeln kann. Bei mir steht jetzt:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Eingabe</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">

<style type="text/css">
body { margin-left:20px; margin-right:20px; margin-top:10px; margin-bottom:0px }
</style>

<script type="text/javascript">
function add2Doc(headlineText) {
 for(i = 1; i < 8; i++) {
  if(i==1) { a="ä"; b="ä"; }
  if(i==2) { a="ö"; b="ö"; }
  if(i==3) { a="ü"; b="ü"; }
  if(i==4) { a="Ü"; b="&Uuml;"; }
  if(i==5) { a="Ä"; b="&Auml;"; }
  if(i==6) { a="Ö"; b="&Ouml;"; }
  if(i==7) { a="ß"; b="ß"; }
  while (headlineText.indexOf(a)>-1) {
   pos=headlineText.indexOf(a);
   headlineText=(headlineText.substring(0, pos)+b+
   headlineText.substring((pos + a.length), headlineText.length));
  }
 }
}
</script>
</head>

<body bgcolor="#ededed">
<form action="">
&Uuml;berschrift:<br>
<textarea name="headline" cols="30" rows="5">test</textarea>
<br><br><br>
Eingaben <input type="button" name="fertig" value="&Uuml;bernehmen" onClick="add2Doc(this.form.headline.value)">
</form>
</body>
</html>

Es geht trotzdem nicht. Im Dokument steht dann "üöäß" statt "üöäß".

Wo kann denn da noch der Fehler liegen?

Pete