Forum Moderators: open

Message Too Old, No Replies

Firefox not recognizing character encoding.

after form.

         

JoaoJose

7:35 pm on Jan 30, 2006 (gmt 0)

10+ Year Member



I've stumped into a little problem. I made a form where you can compare 3 differente products side by side. After you submit the form you get a new page with all the info. The problem is Firefox 1.5 isn't recognizing the character encoding which is very clear with a <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">, instead it shows the default UTF-8.

Any idea if this is a firefox bug or am I missing something? Everything ok with IE and Opera.

Thanks in advance!

encyclo

1:34 am on Jan 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Usually Firefox will submit the contents of a form in the same charset as the page in which the form resides. When you check the page info (Ctrl+I), is the encoding correctly listed as windows-1252?

You can also specify the accepted charset for the for with the

accept-charset
attribute:

<form action="script.cgi" [b]accept-charset="windows-1252,ISO-8859-1"[/b]>

If the page is not showing the windows-1252 encoding, then try ISO-8859-1 or even better send the charset as a HTTP header rather than via the meta tag.

(Note: I specified ISO-8859-1 for the form as windows-1252 is not guaranteed to be cross-platform compatible).

JoaoJose

7:38 am on Jan 31, 2006 (gmt 0)

10+ Year Member



A header("Content-type: text/html; charset=windows-1252"); on my php file did the trick. But I still don't understand why this happens because I have the a correct charset meta tag on both starting and landing pages...

Anyway problem solved :)

Thanks for you help encyclo!