How do I get PHP to tell the server that when I echo text to the
screen, I need for the text to be sent as UTF-8? How does Apache know
the right encoding when all the text is being generated by PHP? If I
build a content management system (I have) and I make sure that all
input is encoded as UTF-8, how will the
server know that the text in the MySql database is UTF-8?
I'm taking all user input and using this function on the input:
I'm doing this so I can output to XML without getting errors about
"You should not sent plain text".
But how will the server know how to serve these pages? How do I tell
it from PHP? I realize I can send a http equiv tag, but that's rather
weak, right?
Is this enough? Any conflicts with Apache?
$sent = headers_sent();
if (!$sent) header("Content-type:text/html;charset:UT F-8");
screen, I need for the text to be sent as UTF-8? How does Apache know
the right encoding when all the text is being generated by PHP? If I
build a content management system (I have) and I make sure that all
input is encoded as UTF-8, how will the
server know that the text in the MySql database is UTF-8?
I'm taking all user input and using this function on the input:
I'm doing this so I can output to XML without getting errors about
"You should not sent plain text".
But how will the server know how to serve these pages? How do I tell
it from PHP? I realize I can send a http equiv tag, but that's rather
weak, right?
Is this enough? Any conflicts with Apache?
$sent = headers_sent();
if (!$sent) header("Content-type:text/html;charset:UT F-8");
Comment