0
votes

I am using php. I have a problem with special chars. I have a word for example it's. When i do encode in php side with

return htmlspecialchars($text,ENT_QUOTES,"UTF-8");

it is returning it's it is correct but browser does not decode it. So in browser it the same. Why does not browser decode that?

thanks

1
Look at the HTML source. Did it double-encode it as 's? - Michael Berkowski
yeah it comes exact the same. I see it with firebug. When i cut that code then put back with firebug it becomes good. - Elbek
Don't check in Firebug, check the raw source. - deceze
What's the browser interpreting the page as? If you're got a Content-type: text/plain, it will NOT be rendered as html. - Marc B
it worked actually i was using framework. But it does not depend on that, i dunno when i changed some settings it worked. But it should not depend on framework :) - Elbek

1 Answers

0
votes

I tested in IE 8

<?php
$text="It's";

echo htmlspecialchars($text,ENT_QUOTES,"UTF-8");
echo '<br><br>';

echo htmlspecialchars($text);

?>

Output:

It's

It's

source Output:

It&#039;s<br><br>It's

Maybe it's a browser setting???