In the "PHP Cookbook", they say (p.589) that to properly set the char encoding of outgoing data to utf-8 it is necessary to edit the default_encoding
configuration to utf-8.
However, I cannot find this configuration in php.ini
. Should I simply add a line that would say default_encoding = "utf-8"
?
I do have a ;default_charset = "iso-8859-1"
. As you can see (;
), right now it is not activated. Should I remove the semi-colon and set it to "utf-8"
? Does that take care of the default encoding?
I also found other encoding directives that I don't know what to do about:
[iconv]
;iconv.input_encoding = ISO-8859-1
;iconv.internal_encoding = ISO-8859-1
;iconv.output_encoding = ISO-8859-1
...
; http://php.net/exif.encode-unicode
;exif.encode_unicode = ISO-8859-15
...
;mssql.charset = "ISO-8859-1"
...
;exif.encode_unicode = ISO-8859-15
Is there any reason why I shouldn't simply replace them all with utf-8
?
This question is related to
php
unicode
encoding
character-encoding
Source: Stackoverflow.com