I have both Apache and PHP configured to use UTF-8 for the default character set, yet it appears that the $_GET superglobal is still encoded in ISO-8859-1. Is the $_GET superglobal always encoded in ISO-8859-1?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
$_GETsuperglobal is presented to PHP however the client sent it. Neither Apache nor MySQL modify it (or its encoding) along the way.In practice, the encoding of values in
$_GETmay depend on the browser. It’s often UTF-8, but you may need to fall back to ISO-8859-1 if it isn’t valid as UTF-8.