i have this string in my utf-8 mysql DB:
“Pruebá de eñes”
When i print it like plain text, everything works ok, but if i load that same field inside an input, textarea, etc, it becomes: “Pruebá de eñes”
How can i solve this problem? =(
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.
First I recommend read this: http://www.joelonsoftware.com/articles/Unicode.html (The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) by Joel Spolsky) really useful.
Then if it’s MySQL you can set the default character set in the connection by “SET NAMES ‘utf8′”. For example in Zend_Framework ($db->query(“SET NAMES ‘utf8′”);)
Another option is add a filter to the data before print it in the screen. I made two handly functions …
}