What function-specific encoding has changed from PHP5.2 to PHP5.4

If there is a file stored in ISO-8859-1, and using the command

echo "test: ".htmlspecialchars("äöü");

The return will only be "test:".

This is because the standard encoding for htmlspecialchars has changed to UTF-8 in PHP5.4. You need to explicitly set the encoding:

echo "test: ".htmlspecialchars("äöü", ENT_COMPAT | ENT_HTML401, 'ISO-8859-1');

Are there any other functions in PHP5.4 that will no longer work properly if you don't set the encoding?

+5
source share
2 answers

htmlentitiesseems to be another function that has been changed: http://de3.php.net/manual/de/migration54.other.php

PHP 5.2- > 5.3 , : http://de3.php.net/manual/de/migration53.php

, htmlspecialchars() htmlentities

, , "Backward Incompatible Changes" -list http://de3.php.net/manual/de/migration54.incompatible.php

+1

latin1 htmlspecialchars htmlXspecialchars : http://ufive.unibe.ch/?c=php54entitiesfix&q=&l=e

0

All Articles