I just converted my website to UTF-8 encoding, after reading that it was the new standard for html5, and did the same with all the MySQL tables, something that was also recommended. But everything becomes more complicated than before when I used ISO-8859-1 ! I'm using accents, mostly in French, and now I have to :
- convert all text with iconv() before displaying it
- use accept-charset="iso-8859-1"... in all forms
- sometimes things like htmlspecialchars($_POST['text'],ENT_QUOTES,"iso-8859-1") in verification forms
- modify SQL queries with CONVERT(field.table USING latin1) REGEXP pattern instead of just field.table REGEXP pattern
- add urldecode(htmlspecialchars_decode(url) in my url_rewrite function ?
When webpages were encoded as ISO-8859-1 none of these steps were necessary ! I had a look in the phpinfo() data but could not find a main directive for encoding.
So I'd like to know if there is a better and easier way to do this ?
Aucun commentaire:
Enregistrer un commentaire