grejon04 Posted November 13, 2007 Author Share Posted November 13, 2007 Ah, i see what's going on here. I bet I could incorporate the iconv function in there too. That way, I could define the function from one of my include files, and just call it whenever I needed it (which is a lot). function htmlentities_iso88592($string='') { $pl_iso = array('ê', 'ó', '±', '¶', '³', '¿', '¼', 'æ', 'ñ', 'Ê', 'Ó', '¡', '¦', '£', '¬', '¯', 'Æ', 'Ñ'); $entitles = get_html_translation_table(HTML_ENTITIES); $entitles = array_diff($entitles, $pl_iso); $string = strtr($string, $entitles); $string = iconv("ISO-8859-1", "UTF-8", $string) return $string; What do you think? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted November 13, 2007 Share Posted November 13, 2007 yup u sure could Quote Link to comment Share on other sites More sharing options...
grejon04 Posted November 13, 2007 Author Share Posted November 13, 2007 I did a lot of work on this, and found that the problem was that sometimes the initial conversions either didn't work, or converted to an html char (like 'â', for example), and when it would seem like the functions weren't converting, they actually were working - it's just that the html entities had been made into plaintext and it didn't see them or something... I ended up declaring a function in one of my include files, and just calling it whenever conversions were needed. The iconv("ISO-8859-1", "UTF-8", $string) function does the majority of the work. Also, for anyone who didn't know as I didn't, changing the meta tag in the HTML like this <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> dictates the output character set. Thanks for your help, effigy, darkfreaks... j Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.