Re: String Encodings - loose guidelines
| From: | Marc Guay | Date: | Tue, 25 Jan 2011 21:26:21 +0000 |
| Subject: | Re: String Encodings - loose guidelines | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311030@lists.php.net to get a copy of this message | ||
> 1.) Saving strings to a database
One thing I always forget to remember is to send tge "SET NAMES utf8"
command to MySQL after making a connection. This will save you 1000
headaches if you're working with non-latin characters. I can't count
the number of times I've thrown htmlentities, htmlspecialchars,
utf8_encode/decode/, stripslashes, etc, etc around trying to figure
out why those É's aren't being saved or read properly. I imagine this
might fall into the category of "best practice".
Marc