character set and encoding

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
jscjso
-


Joined: 27 May 2008
Posts: 15

PostPosted: Fri May 30, 2008 4:36 am    Post subject: character set and encoding Reply with quote

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 View user's profile Send private message
Moxxnixx
-


Joined: 21 Jun 2003
Posts: 1226
Location: Florida

PostPosted: Fri May 30, 2008 6:21 am    Post subject: Reply with quote

Abyss Web Server is Unicode compliant. There is no setting to change. It is automatic. ;)
Back to top View user's profile Send private message Visit poster's website
DonQuichote
-


Joined: 24 Dec 2006
Posts: 68
Location: The Netherlands

PostPosted: Fri May 30, 2008 6:25 pm    Post subject: Reply with quote

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 View user's profile Send private message
Moxxnixx
-


Joined: 21 Jun 2003
Posts: 1226
Location: Florida

PostPosted: Fri May 30, 2008 9:02 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
DonQuichote
-


Joined: 24 Dec 2006
Posts: 68
Location: The Netherlands

PostPosted: Sat May 31, 2008 10:44 am    Post subject: Reply with quote

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 View user's profile Send private message
jscjso
-


Joined: 27 May 2008
Posts: 15

PostPosted: Sat May 31, 2008 4:41 pm    Post subject: Reply with quote

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 View user's profile Send private message
DonQuichote
-


Joined: 24 Dec 2006
Posts: 68
Location: The Netherlands

PostPosted: Sun Jun 01, 2008 1:29 pm    Post subject: Reply with quote

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 View user's profile Send private message
DonQuichote
-


Joined: 24 Dec 2006
Posts: 68
Location: The Netherlands

PostPosted: Wed Jun 04, 2008 8:05 pm    Post subject: Reply with quote

See the Tutorials forum. Adjusting the mime type works.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group