Setting the PHP default encoding to UTF-8

You should set your default_charset to UTF-8:

default_charset = "utf-8"

(PHP Cookbook may have a typo in it if they ask you to change the default_encoding — I’ve never heard of it.)

You’ll also want to make sure that your web server is set to output UTF-8 if you’re going to outputting UTF-8 encoded characters. In Apache, this can be set by in the httpd.conf file:

AddDefaultCharset UTF-8

As for modifying the iconv, exif, and mssql encoding settings, you probably don’t need to set these (your settings have these commented out anyhow), but it’s a good idea to change them all to UTF-8 anyhow.

Leave a Comment