[linux] Re: [linux] apache a kodovanie stranok

Matus UHLAR - fantomas uhlar na fantomas.sk
Pátek Září 12 18:18:11 CEST 2003


On 12.09 17:23, Ondrej Ivanic wrote:
> Matus UHLAR - fantomas wrote:
> >>1) kodovanie nieje v HTTP hlavicke a ani v dokumente
> >>Vysledok je nepredvidatelny
> >
> >standardne kodovanie je iso-8859-1 a ak nie je kodovanie uvedene, mal by ho
> >browser ukazat v tomto.
> 
> Preco? To si zobral kde?

<CITE>
RFC2616 (Hypertext Transfer Protocol -- HTTP/1.1), sekcia 3.7.1
(Canonicalization and Text Defaults):

   The "charset" parameter is used with some media types to define the
   character set (section 3.4) of the data. When no explicit charset
   parameter is provided by the sender, media subtypes of the "text"
   type are defined to have a default charset value of "ISO-8859-1" when
   received via HTTP. Data in character sets other than "ISO-8859-1" or
   its subsets MUST be labeled with an appropriate charset value. See
   section 3.4.1 for compatibility problems.
</CITE>

> >>5) kodovanie je v HTTP hlavicke a dokument specifikuje ine
> >>Mozilla pouzije z HTTP hlavicky
> >>IE pouzije z dokumentu
> >
> >... a porusuje standard. 
> 
> Aky? HTTP? To niekde nieje.

Ale je: http://www.w3.org/TR/html4/charset.html

<CITE>
To sum up, conforming user agents must observe the following priorities when
determining a document's character encoding (from highest priority to
lowest):

   1. An HTTP "charset" parameter in a "Content-Type" field.
   2. A META declaration with "http-equiv" set to "Content-Type" and a value
      set for "charset".
   3. The charset attribute set on an element that designates an external
      resource.
</CITE>

> Chyba moze byt aj na strane web serveru, 

chyba moze byt ale to uz je _chyba_.

> lebo web server by mal/moze (en: may) pouzit informacie z meta tagu 
> ktory na atribut 'http-equiv' na vytvorenie odpovedajucej HTTP hlavicky.

haluzis? to chces este aj do servera implementovat [xh]tml parser?
nechces nahodou do apache integrovat jadro mozilly?

> Paradoxne aj IE ani Mozilla je z toho von:
> 1) Mozilla pouzije HTTP headre a spolahne sa na to ze web server nieco 
> spravil...

mozilla dodrzi standard.

> 2) IE pouzije to co je v dokumente a spolahne sa na to ze web server 
> nieco spravil...

IE si ako vzdy mysli ze je mudrejsi ako vsetci ostatni (a nie je to tak) a
urobi zle.

HTML klient musi casto poznat charset dokumentu PRED tym, ako ho parsuje,
predoze typ kodovania moze dane parsovanie ovplyvnit.

P.S. prosim ta nabuduce dopredu netvrd ze mas pravdu a iny ju nemaju, kym si
to neoveris...

-- 
Matus UHLAR - fantomas, uhlar na fantomas.sk ; http://www.fantomas.sk/
Warning: I don't wish to receive e-mail advertising to this address.
Varovanie: Nezelam si na tuto adresu dostavat akukolvek reklamnu postu.
99 percent of lawyers give the rest a bad name. 



Další informace o konferenci linux