I have a really simple form that takes a textarea and places the contents inside a MySQL database and then a website displays that information. Up until now everything has worked fine including special characters like apostrophes and bullets, however, all of a sudden now apostrophes cause the form to error out and bullets show up as this: •
All the pages are meta encoded as UTF-8, the database collation is UTF-8 and the text area string is being processed by the utf8_encode command.
What could cause this to suddenly happen?
I've been searching around on here for an answer and I can only find situations where people are missing UTF-8 on the database or on the web pages/forms. My only assumption is a PHP version update by the host, however, I cannot confirm that as they use a proprietary system that doesn't let me see the current running version number and I don't know if it would be affected in this way.
If it matters, the textareas are always wrapped in HTML pre tags for formatting.
I'm obviously a little behind when it comes to char encodings - make sure you're correctly declaring the charset.
https://www.w3.org/International/questions/qa-html-encoding-declarations
html5 only requires <meta charset="utf-8">. If you're using this, make sure you also use <!DOCTYPE html> at the top of your html, otherwise you may run into HTML4 issues where <meta charset="utf-8"> won't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With