I'm working on someones page and im just updating it. Now the page is very old and is using old html 4 coding.
I am adding some content within the <p> tags and its giving question marks for every quotation mark. Now I know that you need html codes for each one but i never have this problem on my sites?
I started of by changing the doctype to XHTML transitional, but that didnt change anything, then I added
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> instead of <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
but it still does it.
Am I missing something or should i be replacing all quotation marks with html codes?
Use a charset that is appropriate for your language, probably ISO-8859-1
Don't forget to check the headers in case the server is sending a different value.
The editor, the server, the browser, and the font-family all have to have the support for the charset and special characters used.
Last edited by Fang; 06-14-2010 at 10:32 AM.
At least 98% of internet users' DNA is identical to that of chimpanzees
I'm working on someones page and im just updating it. Now the page is very old and is using old html 4 coding.
You don't need to update anything. HTML 4.01 is not old. HTML 4.01 strict Doctype and coding are as good as XHTML Doctype and coding. XHTML is not the new version of HTML 4.01, it is just a HTML 4.01 adapted to handle XML objects, codes and files. The new version of HTML would be HTML 5, but this is not yet (or incomplete) implemented in all the browsers. HTML 5 will make HTML/XHTML Doctypes useless, as the coder will be able to use either HTML style coding or XHTML style coding on his will.
Regarding the charset. It is true that UTF-8 is recommended instead of latin 1 (ISO-8859-1), but if your pages were written in ISO-8859-1, changing the special characters in order to fit the UTF-8 would be an awfully find/replace job. ISO-8859-1 remains still a valid charset, thus I don't think you need to change it by all means.
Post a link to that site, and I will tell you how old is your code and what you might need to make it up-to-date.
Thanks for that kor.
Its in your inbox, I'm just going through the w3c validator, if i still get question marks il use the HTML codes instead.
Whether its the latin char or the utf8 i still get the ?
The server is sending UTF-8, so using the meta tag with ISO-8859-1 is pointless.
The browser will use the server header and ignore the meta tag.
The same is true of using xhtml while the server sends it as html.
Change the apostrophes to the ascii value (used on the keyboard) rather than a probable cut & paste from a Word document. A dedicated html editor will have an option to convert these special characters.
At least 98% of internet users' DNA is identical to that of chimpanzees
OK thanks guys
The problem was that it was copied straight from word.
Is there a quick way to convert these to normal punctuation marks in dreamweaver or do I have to go through them one by one?
I believe Dreamweaver has an option to save the document in a specific charset.
As the server is sending UTF-8, use this, and change the meta tag to the same.
At least 98% of internet users' DNA is identical to that of chimpanzees
The server is sending UTF-8, so using the meta tag with ISO-8859-1 is pointless.
I suspect rather that the server is sending latin 1 (ISO-8859-1). I had a similar problem lately. I had to switch data written in latin 1 from an old ACCESS MDB to a MySQL DB. I could not use UTF-8 (text was in French), thus I leave it latin 1 and I was forced to use ISO-8859-1 charset in my web document as well. It is true that I had some difficulties to query the DB (AJAX - php/MySQL) but I used utf8_encode(), utf8_decode() [and json_encode()] PHP methods to pass the special characters.
Well, if you paste the text in the Design Window of DW, it does not matters which charset code is used. But if you paste the text straight into the Code Window, it matters.
For instance: I copy/paste français société in the Design Window. The text will be automatically parsed as français société in the Code Window.
I guess you must change the default encoding in the Preferences of DW as well: Preferences->New Document->Default encoding
Bookmarks