#47433 [Opn->Bgs]: signature of htmlentities() does only work with all 3 parameters

From: Date: Wed, 18 Feb 2009 21:18:54 +0000
Subject: #47433 [Opn->Bgs]: signature of htmlentities() does only work with all 3 parameters
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1900@lists.php.net to get a copy of this message
ID: 47433 Updated by: jani@php.net -Summary: signature of htmlentities-function does only work with all 3 parameters Reported By: mbeiser at w-commerce dot de -Status: Open +Status: Bogus Bug Type: *Languages/Translation Operating System: Debian Etch PHP Version: 5.2CVS-2009-02-18 (CVS) New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: ------------------------------------------------------------------------ [2009-02-18 07:54:59] mbeiser at w-commerce dot de Description: ------------ With the PHP Version 5.2.0 there comes a charset-problem concerning the htmlentities-function. While it has worked under PHP4 (setting up the parameters using htaccess), we can't manage to use a htmlentities-function without setting up the charset(UTF-8) with the third parameter. This was tested under Debian Etch13, Ubuntu LTS 8.04 with the PHP Versions 5.2.0 and 5.2.8. Reproduce code: --------------- <?php $text = "Text mit Umlauten: ä ü ö"; echo "htmlentities without exp. charset and htaccess:".htmlentities($text, ENT_COMPAT)."\n"; echo "htmlentities utf-8 :".htmlentities($text, ENT_COMPAT, 'utf-8')."\n"; ?> Expected result: ---------------- htmlentities without exp. charset and htaccess: Text mit Umlauten: ä ü ö htmlentities uf8 : Text mit Umlauten: ä ü ö Actual result: -------------- htmlentities without exp. charset and htaccess: Text mit Umlauten: ä ü ö htmlentities uf8 : Text mit Umlauten: ä ü ö ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47433&edit=1

« previous php.doc.bugs (#1900) next »