View previous topic :: View next topic |
Author |
Message |
jscjso -
Joined: 27 May 2008 Posts: 15
|
Posted: Fri May 30, 2008 4:36 am Post subject: character set and encoding |
|
|
Hi,
W3C instruction in http://www.w3.org/International/O-charset suggests that I have to align my character encoding declaration with my server.
I have <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > in my html file. I search through Abyss installation and cannot find how to set utf-8 in my Abyss server.
Do I need to declare that in my Abyss server as W3C says?
If so, how? |
|
Back to top |
|
|
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
Posted: Fri May 30, 2008 6:21 am Post subject: |
|
|
Abyss Web Server is Unicode compliant. There is no setting to change. It is automatic. ;) |
|
Back to top |
|
|
DonQuichote -
Joined: 24 Dec 2006 Posts: 68 Location: The Netherlands
|
Posted: Fri May 30, 2008 6:25 pm Post subject: |
|
|
Moxxnixx wrote: | Abyss Web Server is Unicode compliant. There is no setting to change. It is automatic. ;) |
Can you please explain that?
I searched through my server config, and I could not set such headers. It may be possible to set the mime type from "text/html" to "text/html;charset=utf-8", but I did not try this. This is also a server configuration and should therefore be valid for ALL files of this type on the server.
If you generate the pages from script (PHP for instance), you can sent the appropriate header. This really is THE way to communicate the character encoding, as hacking it from the encoded(!) content is like breaking into a safe to get the key. In general, this will not work, unless you use a character encoding that is 7-bit ascii compatible.
There is no way to "automagically" determine the used encoding from a file. Every utf-8 file is perfectly valid latin-1 (not the other way around though). It just renders differently. |
|
Back to top |
|
|
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
Posted: Fri May 30, 2008 9:02 pm Post subject: |
|
|
DonQuichote wrote: | Can you please explain that? |
I'm saying there are no settings on the server required to use UTF-8.
It is dependent on the document headers and the visitor's browser settings. |
|
Back to top |
|
|
DonQuichote -
Joined: 24 Dec 2006 Posts: 68 Location: The Netherlands
|
Posted: Sat May 31, 2008 10:44 am Post subject: |
|
|
OK.
That is not exactly what I call "unicode compliant". It just means that the web server send every file without an encoding in it's Content-Type header.
The effect of this is that the "default" encoding is used for every .html or .htm file.
According to the standards, the default is iso-8859-1, but IE renders it as cp1252.
This effectively means all your HTML files are not utf-8, and that I do not know how to change that without turning them into scripts.
To the original poster: the meta header should work, but should also not be necessary. It is just a dirty fix. |
|
Back to top |
|
|
jscjso -
Joined: 27 May 2008 Posts: 15
|
Posted: Sat May 31, 2008 4:41 pm Post subject: |
|
|
DonQuichote, Moxxnixx,
Thanks for the discussion, I understand more.
DonQuichote,
I have my meta statement in my html already. But still, the W3C site says that I need both; the server setting and meta statement.
Are you sure just meta statement is enough? Since the server does not have the setting, the client browsers might initially treat it as it own default. Like IE as cp1252, then my utf-8 arrives from my host. Will that create a moment of confusion?
jscjso |
|
Back to top |
|
|
DonQuichote -
Joined: 24 Dec 2006 Posts: 68 Location: The Netherlands
|
Posted: Sun Jun 01, 2008 1:29 pm Post subject: |
|
|
jscjso wrote: | I have my meta statement in my html already. But still, the W3C site says that I need both; |
The meta header was invented for anyone who could not change the server HTTP headers (anyone who puts HTML files at a provider's machine, for instance). If you do it by the book, you do not need the meta tag at all. The meta tag is just an override of the HTTP header. This works for other HTTP headers as well: the Refresh header is the most known example, and the header for the scripting language used is even described this way in the HTML 4.01 specs.
A good browser should parse the HTML content with the data from the HTTP headers, and when it encounters an overriding meta tag, restart parsing with the updated information. Off course, this can only work if the meta tag is legible with the HTTP header info. I think that is one of the reasons why utf-8 is so popular. A site in utf-16 could never be parsed this way.
I do not know how "good" individual browsers behave, though. |
|
Back to top |
|
|
DonQuichote -
Joined: 24 Dec 2006 Posts: 68 Location: The Netherlands
|
Posted: Wed Jun 04, 2008 8:05 pm Post subject: |
|
|
See the Tutorials forum. Adjusting the mime type works. |
|
Back to top |
|
|
|