Page 1 of 1

A charset problem

Posted: Wed Mar 12, 2008 11:27 am
by Waxxy
Problem solved, thank you!

Re: A charset problem

Posted: Wed Mar 12, 2008 11:48 am
by andym01480
You need to set it in the headers of the html/xhtml output

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"></meta>

Change iso-8859-1 to what you want!

Re: A charset problem

Posted: Wed Mar 12, 2008 12:20 pm
by Waxxy
that does not work. That was the first thing what i have done.

Re: A charset problem

Posted: Wed Mar 12, 2008 12:48 pm
by andym01480
You haven't done it in the headers!
View-source looks like this

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></meta>
 
<form action="translation.php" method="post" name="translate">
  <p>Russian</p>
  <p>
    <textarea name="translate" cols="45" rows="5" value=""></textarea>
  </p>
  <p>English</p>
  <p>
    <textarea name="textarea2"  cols="45" rows="5" value ="'.$english.'"></textarea>
</p>
</form>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
There are no headers there!
You want something like

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"></meta>
<title>Translation page</title>
</head>
<body>
Then output your stuff
</body>
</html>
You've also not done the textarea right

Code: Select all

 <textarea name="textarea2"  cols="45" rows="5" value ="'.$english.'"></textarea>
Should be

Code: Select all

echo '  <textarea name="textarea2"  cols="45" rows="5">'.$english.'</textarea>';
and the same for the Russian bit!