Let’s say I’m including a file which contains html. The html have characters as exclamation symbols, Spanish accents (á, ó). The parsed included text gets processed as symbols instead of their correct value. This happens on FF but not on IE (8).
I have tried the following functions:
htmlspecialchars, htmlentities, utf8_encode
include htmlentities("cont/file.php");
Sample file.php contents:
<div>Canción, “Song Name”</div>
Output:
Canci�n, �Song Name�
This is what end up working on two different your code and mine doing the trick; the reason being hard to know but something with parsing.
This is browser showed (FF + IE)–>
alt text http://i77.photobucket.com/albums/j65/speedcoder/4-3-20101-22-31PM.png
Sample** (‘include’ function not use, so Output Buffer not needed):
This one didn’t work for me:
If the above sample using an include file with html code it didn’t convert at least for me the characters. I changed it to not been include file and worked with the utf8_encode, but the problem is that my code needs where using include function which din’t work.
The next sample below uses include method and output buffer which allowed code to be rendered and parsed before utf8_encode encoding transpired.
My Code Scenario (for my specific scenario has to be with ob since include file also contains code which needs to be parsed first):
Thanks for helping me figure it out “Ondrej Slinták”!!!