PHP 5.6 update and special characters

I have a website where I used php to include sections, and not to duplicate code for each page. However, recently my web hosting upgraded PHP to 5.6, and now all of my Æ, Ø and Å give me a replacement character ().
I do not start any databases, and setting the encoding in html did not help.

I am very inexperienced with PHP, so I have no idea how to fix this.
Please any help would be wonderful!

+4
source share
4 answers

I had the same problem after upgrading from php 5.5. up to 5.6.

Solved it by setting default_charset to an empty line in the script:

ini_set("default_charset", "");

, acceess php.ini, default_charset = "" .

: https://www.saotn.org/php-56-default_charset-change-may-break-html-output/

+5

PHP 5.6 default_charset UTF-8. .

php ISO-8859-1 ( ), .htaccess :

php_value default_charset ISO-8859-1

ISO-8859-1, php ( default_charset):

<?php 
header('Content-Type: text/html; charset=iso-8859-1');
?>

php textfiles utf8 .

+3

PHP 5.5 5.4 - , CBroe , PHP 5.6 UTF-8, - . , PHP 5.5 . WHM, EasyApache Apache PHP .

, PHP , , 5.6 - UTF-8. , UTF-8 , .

+1

- multi host, - , PHP, 5.4, reset default_charset /etc/php.../php.ini:

[PHP] :

default_charset = ""

It will not make install PHP UTF-8 encoding for all the php files, especially for the old or the national character set, such as windows-1251, windows-1257, iso-8859-1, iso-8859-2, ISO-8859-13, etc.

Or, if you are a developer, be sure to use Rob answer and add the code directly to you php application ini_set("default_charset", "");

0
source

All Articles