follow us on google+ follow us feedburner

FORUM
We will close this forum soon. Please, now use Stack Overflow. Don't forget to add the tag "easyphp" to your post.

You can follow your activity on Stack Overflow with the Stack Exchange Android App. An iPhone version is coming...

One more thing. EasyPHP is on GitHub. You will find the repositories at this address : https://github.com/easyphp. If you want to report a bug, please use the GitHub issue management system of each repository.

htmlentities doesn't work!



November 14, 2012 04:31PM
Hello Dear Reader!

In my case the PHP function htmlentities($str) doesn't work with EasyPHP 12.1. It returns the argument until $str contains german Umlaute (ä, ö, ü, Ä, Ö, Ü, ß); in this case htmlentities() doesn't replace them by ä etc., but returns a completely EMPTY string! Other special characters like " are replaced in the correct way (").

This error is completely new. I've never seen this in former versions of EasyPHP (up to 3.9.1). This function is very important for a well-designed website and i use it for nearly every alphanumeric output. Maybe this mistake will occour in other languages, too...

Can anyone help me? - Thank you!
Options: ReplyQuote
November 14, 2012 05:34PM
Hello again,

the problem also occurs with other signs like €, ½, ©, ¿, à, á, â, ã, ä, å.

???
Options: ReplyQuote
Posted by: Russell
November 14, 2012 09:04PM
Could this be due to EasyPHP12.1 using PHP 5.4 whereas your other versions all used an older version.

See the php docs for a description on how htmlentities() has changed in 5.4

[www.php.net]

Try specifying the encoding parameter to be 'ISO-8859-1'.

Hope that helps.
Options: ReplyQuote
November 16, 2012 06:09PM
Thank you very much, Russell! htmlentities($str, ENT_QUOTES ,'ISO-8859-1') does exactly what htmlentities($str) did before PHP 5.4.

But this is a really bad surprise. I had not expected this and must now change any program that I've written in the past decade. PHP for me was always a part of the "good", but now I feel treated like I was accustomed from MS, Apple or Adobe.
Options: ReplyQuote
Posted by: Daniel
November 26, 2012 05:14PM
I am very disappointed too to discover that I have to add
,ENT_QUOTES ,'ISO-8859-1'
in all the lines I have written till today.
Please fix that
Options: ReplyQuote
Posted by: Russell
November 27, 2012 12:31PM
Since its a change by the PHP Group, I think you best take the problem up with them as the authors of EasyPHP are powerless in this aspect.
Options: ReplyQuote


Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.