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? Link to comment https://forums.phpfreaks.com/topic/77009-solved-character-set-encoding-smart-quotes-problem/page/2/#findComment-390392 Share on other sites More sharing options...
darkfreaks Posted November 13, 2007 Share Posted November 13, 2007 yup u sure could Link to comment https://forums.phpfreaks.com/topic/77009-solved-character-set-encoding-smart-quotes-problem/page/2/#findComment-390393 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 Link to comment https://forums.phpfreaks.com/topic/77009-solved-character-set-encoding-smart-quotes-problem/page/2/#findComment-390720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.