Currupted db...interesting...looks like then do a mysql table delete and create it again?
I will try that but first I am wondering could it be that because
my html page is utf8 and then when it inserts the data in the the
database that is set to utf8...on insert could the db be converting
the data again....?
But in the meantime I did tests:
The $title value comes from a submitted webform, with title set to:
<input type="text" value="<? echo utf8_decode(POST[title]) ?>"
HTML tag is:
html xmlns="
http://www.w3.org/1999/xhtml"; lang="ar" xml:lang="ar" >
HTML Meta:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
The <form> tag element has no:
accept-charset="UTF-8"
when I php echo result from the db to the page I use:
nl2br(utf8_decode($title))
TESTS:
when I changed mysql query to utf8_encode($title) to utf8_decode($title):
database shows:
??? ?? ??? ?? ??? ??
after db insert, php echo shows:
??? ?? ??? ?? ??? ??
When I remove both utf8_encode and utf8_decode from the mysql insert query:
database shows:
?? ?? ???? ??
After db insert, php echo shows:
?? ?? ???? ??
To test for existence of double encoding I did:
utf8_decode(utf8_decode($title))
db and php echo shows: ???? ?? ???? ??
Changed back to utf8_encode($title):
db shows: ÙÙ? اÙ?خط ÙÙ?
php echo shows: ف�? ا�?خط ف�?
NEW TESTS:
I just added: this to the form tag:
<form accept-charset="UTF-8">
and removed utf8_decode from the form input tag, which is now set to:
<input type="text" value="<? echo POST[title]; ?>"
using mysql insert after form submit with no utf8_encode and utf8_decode for title I see $title:
database shows:
?? ?? ???? ??
After db insert, php echo shows:
?? ?? ???? ??
using mysql insert after form submit with utf8_encode($title):
database shows:
ÙÙ? اÙ? Ù
After db insert, php echo shows:
ف�? ا�? ف
FOR PHP ECHO TO THE PAGE I changed:
nl2br(utf8_decode($title))
TO:
$title
did db insert without utf8_encode and decode db shows: ? ?? ?? ??
did db insert with utf8_encode I see: Ù? ÙÙ? اÙ?خط
AFTER ALL OF THIS I will delete the table and create a new one...?