mikefrederick Posted February 27, 2008 Share Posted February 27, 2008 see http://www.ivoiresondage.com/index.php and select a region from the drop down box. for any department that comes from a database with special characters (accent marks), ? will show up instead of the character. It doesn't do this for the regions...but I don't think it's related to the AJAX. Anyone? Quote Link to comment Share on other sites More sharing options...
aebstract Posted February 27, 2008 Share Posted February 27, 2008 I don't see a drop down, and every accent mark I see on the website, is there.. I clicked a few of the links on the left side and it seems some of those sub pages have accent marks that work as well? Quote Link to comment Share on other sites More sharing options...
Psycho Posted February 27, 2008 Share Posted February 27, 2008 Yeah, I was going to help. But, it took me many attempts to find a combination that displayed the problem. Quote Link to comment Share on other sites More sharing options...
killsite Posted February 27, 2008 Share Posted February 27, 2008 PHP supports a few different ways of converting the data. iconv tends to work best for most. mbstring extension: mb_convert_encoding(string, to, from) iconv extension: iconv(from, to, string) recode extension: recode_string(request, string) built-in function: utf8_encode(string) (converts from ISO-8859-1 to UTF- So handling input might look something like this: <?php $test = $_REQUEST['charset_check']; /* our test field */ $field = $_REQUEST['field']; /* the data field */ if (bin2hex($test) == "c3a4e284a2c2ae") { /* UTF-8 for "ä™®" */ /* Nothing to do: it's UTF-8! */ } elseif (bin2hex($test) == "e499ae") { /* Windows-1252 */ $field = iconv("windows-1252", "utf-8", $field); } else { die("Sorry, I didn't understand the character set of the data you sent!"); } mysql_query("INSERT INTO table SET field = _utf8'" . addslashes($field) . "'") or die("INSERT failed: " . mysql_error()); Quote Link to comment Share on other sites More sharing options...
aebstract Posted February 27, 2008 Share Posted February 27, 2008 Oh wow, I went back and there was a little form thing.. wonder why that didn't show up the first time O.o 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.