I’m not sure it’s even possible, but something tells me it may be. I’d appreciate expert guidance.
My WordPress-based website gets bits of dynamic content from this other site (“this day in aviation” widget):
http://www.youngeagles.com/factzone/thisday.asp
I embed that data into my site using this bit of code:
<div id="this_day_in_history">
<h3>This Day in Aviation History</h3>
<script src="http://www.youngeagles.com/thisday/absolutecr.asp?z=1" type="text/javascript"></script>
</div>
On the original site, all the characters display perfectly fine, but when they are displayed on my site, some of the quotes and a few French and Spanish characters are replaced with <?>.
Is there a magic line of code that would allow me to fix the look of the characters on my site?
Preferably with jQuery or JavaScript, or maybe there’s a PHP solution?
I would be grateful for your suggestions!
EDIT: the initial solution was offered as answer to this question by Adam MacDonald, but the snippet of code he generously composed needed a couple of further adjustments for my purposes. The final solution was offered by Phoenix in a separate thread: A bit of PHP code wipes out WordPress site
I find using iconv works the best in php .. something like:
iconv(“UTF-8”, “ISO-8859-1//IGNORE//TRANSLIT”, $str)
It attempts to match the character to the best of its ability, and if not, drops it
Also, utf8_encode/decode sometimes works fine.
EDIT:
perhaps something like this …
EDIT 2:
just in case you want to see the changes in place of your current code: