I retrieve data from a MySQL database which is often in foreign languages and encoded with UTF-8. This displays fine normally but when set as the value for a textarea or text box it doesn't display correctly. Infact it looks like this:
ыкаепнрошгув
When normally it looks like this (random Russian letters):
ыкаепнрошгув
I've set the encode type in the html header as usual:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
And I've explicitly set UTF-8 encoding for the form too.
<form action='process.php' method="POST" enctype="multipart/form-data" accept-charset="UTF-8">
I can't think why it's doing this! I can copy & paste in UTF-8 encoded characters no problem. The form saves them to the DB as UTF-8. The page retrieves and displays them as UTF-8 but when I try to set a form element with encoded characters it goes fubar! Any ideas?