Closed indigofeather closed 11 years ago
I can not reproduce that, it displays fine here. Are you use your mbstring extension is installed and activated?
in the http://php.net/manual/en/function.htmlentities.php say...
Like htmlspecialchars(), htmlentities() takes an optional third argument encoding which defines encoding used in conversion.
If omitted, the default value for this argument is ISO-8859-1 in versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards.
Although this argument is technically optional, you are highly encouraged to specify the correct value for your code.
I recommimt fixed it to be
htmlentities($var, ENT_COMPAT, \Fuel::$encoding);
To suport for php5.4 early version.
So you say it goes wrong in PHP 5.3.3 -> 5.4.0? I'll run some more tests.
@SDpower is right. htmlentities() needs 3rd param in PHP 5.3.
\Security::htmlentities()
is better.
My PHP version is:
PHP Version 5.3.10-1ubuntu3.5
When I use 5.4, the problem is gone.
you should use 5.4, it has some very handy upgrades. I think it's harder when you done some things in 5.4 to go back to 5.3 I hope the fuelphp developers are very aware of those php changes.
Robbie Bardijn Front-end Developer
Mobile: 0472 / 79.88.63 robbie.bardijn@gmail.com
On 24 Jan 2013, at 09:34, Lance He wrote:
My PHP version is:
PHP Version 5.3.10-1ubuntu3.5 When I use 5.4, the problem is gone.
— Reply to this email directly or view it on GitHub.
@kenjis is better!!
Agreed!
in Debug::format() @ line: 194
It use
htmlentities()
to encode the string. If the content of string is 'UTF-8' encoding, it will become unreadable result. Ex:result:
According to http://www.php.net/manual/en/function.htmlentities.php.
I try to fix it:
result is OK: