Bug #69114 [Opn->Fbk]: Undocumented 5.6 BC Break: default encoding ISO-8859-1 -> UTF-8
| From: | yohgaki@php.net | Date: | Sat, 28 Mar 2015 21:27:44 +0000 |
| Subject: | Bug #69114 [Opn->Fbk]: Undocumented 5.6 BC Break: default encoding ISO-8859-1 -> UTF-8 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191669@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69114&edit=1
ID: 69114
Updated by: yohgaki@php.net
Reported by: maggus dot staab at googlemail dot com
Summary: Undocumented 5.6 BC Break: default encoding
ISO-8859-1 -> UTF-8
-Status: Open
+Status: Feedback
Type: Bug
-Package: Documentation problem
+Package: Unknown/Other Function
PHP Version: 5.6.6
-Assigned To:
+Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
When these
iconv.internal_encoding
mbstring.internal_encoding
are empty, default_charset should be used. There was a bug and it was fixed. If there is another
bug, please paste simple reproducible script here.
proxymus, what is user "default_charset"? If it sets to ISO-8859-1, then PHP should set
charset to ISO-8859-1. I'm guessing that you have empty "default_charset". If this is
the case, "default_charset=ISO-8859-1" should fix your problem.
Previous Comments:
------------------------------------------------------------------------
[2015-03-16 14:22:55] proxymus at spaml dot de
In my case it helps to add the following to my .htaccess file
<Files ~ "\.php?$">
Header set Content-Type "text/html; charset=ISO-8859-1"
</Files>
------------------------------------------------------------------------
[2015-03-12 12:27:58] carlos dot buenosvinos at gmail dot com
Same here. You also need to update your php.ini with mbstring.internal_encoding =
"ISO-8859-1". Now everything is working. However, it looks like the fallback to
default_charset is not working.
------------------------------------------------------------------------
[2015-02-24 13:00:17] maggus dot staab at googlemail dot com
Description:
------------
With PHP5.6 the default encoding changed from ISO-8859-1 to UTF8.
This bc break is not mentioned in the list of BC changes:
http://php.net/manual/en/migration56.incompatible.php
The charset related docs mention that
iconv.input_encoding
iconv.output_encoding
iconv.internal_encoding
mbstring.http_input
mbstring.http_output
mbstring.internal_encoding
is deprecated as of 5.6 and we should use default_charset instead:
http://php.net/manual/en/ini.core.php#ini.default-charset
For non-utf8 legacy app which are updated to PHP5.6 it is not clearly documented how the path is.
just setting ini_set('default_charset', 'ISO-8859-1'); does not do the trick,
because of the deprecated above mentioned settings still default to UTF8.
It feels like non-utf8 apps can only be configured using deprecated settings like (which does not
work by the way)
ini_set('default_charset', 'ISO-8859-1');
iconv_set_encoding("internal_encoding", 'ISO-8859-1');
iconv_set_encoding("output_encoding", 'ISO-8859-1');
iconv_set_encoding("input_encoding", 'ISO-8859-1');
How is the correct way to migrate a non-utf8 app to 5.6? How should the settings look like to be
compatible to 5.5 defaults and also be future proof (so dont rely on deprecated settings)?
Such a path should be documented in the migration guide.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69114&edit=1