Forum Moderators: open

Message Too Old, No Replies

apostrophe causing problems in ie6

apostrophe causing problems in ie6

         

drooh

10:17 pm on Dec 23, 2008 (gmt 0)

10+ Year Member



I have a form that submits post data info. I am using php to capture the data and display errors if fields are blank. Everything works fine in firefox and ie7.

If there is a curly apostrophe in one of the fields and the form is submitted the 1st field is left empty.

This is in my head
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

If I remove it the problem seems to go away.

Also, i can leave that in and add a hidden input with a dummy value and it seems to make the rest of the form work, it just attacks the 1st field. very wierd.

any ideas comments?

drooh

10:21 pm on Dec 23, 2008 (gmt 0)

10+ Year Member



I changed it to this
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

and it seems to work.

im glad its fixed but would like to know why this is?

drooh

4:56 pm on Dec 24, 2008 (gmt 0)

10+ Year Member



now all the curly apostrophes that are in my db when echoed out show up as little black diamonds with a white question mark inside them?

rocknbil

8:51 pm on Dec 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is an issue with a) your document character encoding (as you discovered) and b) the collation of your data tables.

Character encoding, entity references and UTF-8 [webmasterworld.com]

These are most likely "smart quotes" from MS word or something that are above the standard ASCCI set. I'd strip them out, or substitute them for html entities, (&quot;) but many seem to like to keep them in. In this case you'll need to change your table collation to support them.

drooh

9:18 pm on Dec 24, 2008 (gmt 0)

10+ Year Member



its seems that when i have all my html/php documents using the same utf-8 encoding everything was ok. i did have to replace those characters that were entered when it was ISO-8859-1. But now I can enter those curly characters and a few more using the utf-8 and it seems ok. also, i did check my mysql db and its using utf-8. so i guess im good now.

from this i learned that im just going to use utf-8 for now on and not ISO-8859-1. from what ive read utf-8 is more universal than ISO-8859-1 and i dont see much reason to use ISO-8859-1.