Forum Moderators: open

Message Too Old, No Replies

How to get rid of ;charset=ISO-8859-1 chars on netscape

;charset=ISO-8859-1 removing from html page

         

yateenjoshi

1:59 pm on Jan 27, 2003 (gmt 0)

10+ Year Member



Hi,

I am developing a cgi-script based web-page and printing the results on a html page. Following line is being used for that.
print $queryForm->header("text/html\n\n");
print $queryForm->start_html( -title => "Some try", -bgcolor => "#FFFFFF", -text => 'black');
print "<meta http-equiv=\"Content-Type:text/html \" >\n";

The page works perfectly and shows every thing in proper format, except that on the left top corner of the page, following chars appear:
;charset=ISO-8859-1
Can you some one tell me how to get rid of these chars on the page?

Thanks and regards,

Yateen V. Joshi

DrDoc

6:18 pm on Jan 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World!

Change the line:

print "<meta http-equiv=\"Content-Type:text/html \" >\n";

to
print "<meta http-equiv=\"Content-Type:text/html; [b]charset=ISO-8859-1[/b]\">\n";

and it should work :)

yateenjoshi

5:25 am on Jan 28, 2003 (gmt 0)

10+ Year Member



Thanks DrDoc,
but that didn't work, probably, putting those chars cause the appearance of the chars on the browser. Your solution might be correct, but I am not gettting the results(I am not sure why it is not working).

Any idea why it may not be working?

Regards,

Yateen..

DrDoc

7:57 am on Jan 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And you're sure that it's not printed/generated by the script?

You might want to check into that ..

yateenjoshi

10:08 am on Jan 28, 2003 (gmt 0)

10+ Year Member



Well, the error is recovered. It is with the version of perl
being used. If one uses 5.6, this error comes, if 5.005 is
used, it is gone.

Thanks for your help.

Regards,

Yateen V. Joshi

DrDoc

5:28 pm on Jan 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I wouldn't say that the error is in "Perl" .. just in one of the libraries used to print out HTML :)

Glad you figured out why though ..

g1smd

8:58 pm on Jan 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Since the line you are trying to generate is actually supposed to be:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

you need to change your print instruction, yet again,

from:
print "<meta http-equiv=\"Content-Type:text/html; charset=ISO-8859-1\">\n";

to be:
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n"; instead.

Make sure that you also delete the unnecessary colon between Content-Type and text/html from your old version, as well.

If there is any other occurrance of the words ;charset=ISO-8859-1 anywhere nearby, then remove that copy from your code.

yateenjoshi

5:15 am on Jan 29, 2003 (gmt 0)

10+ Year Member



Hi,

The correct thing I could figure out after some more
efforts is simple.
Perl5.6 does not do proper checks for 'breaks' in the header
Hence, following was creating the problem.
print $page->header("text/html\n\n");

Instead of this, if one uses
print $page->header("text/html");

or simply,
print $page->header;
This error is gone even if one is using perl 5.6.
I have not put any other statement including meta and
content type etc, but the error is gone and pages are
working fine!
Thanks for every one's inputs.

Regards,

Yateen V. Joshi

g1smd

8:29 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Run the page through the site at [validator.w3.org...] and it will show you a list of the errors in the HTML code that you are generating.