SóProvas


ID
868753
Banca
CESPE / CEBRASPE
Órgão
TRE-MS
Ano
2013
Provas
Disciplina
Programação
Assuntos

No que se refere a arquivos HTML, assinale a opção correta.

Alternativas
Comentários
  • Correto. Mas é polêmica. Veja que o próprio W3C (declara que o byteorder mark (BOM) tem a mais precedência do que qualquer outra declaração, incluindo HTTP header (http://www.w3.org/International/questions/qa-html-encodingdeclarations.en). Mas a CESPE considera a HTTP Header (cabeçalho) o primeiro. Por ordem ficaria assim: HTTP Header, BOM, , atributo charset em um link.

  • HTTP precedence

    The HTML5 specification was recently changed to say that the byte-order mark should override any encoding declaration in the HTTP header when detecting the encoding of an HTML page. This can be very useful when the author of the page cannot control the character encoding setting of the server, or is unaware of its effect, and the server is declaring pages to be in an encoding other than UTF-8. If the BOM has a higher precedence than the HTTP headers, the page should be correctly identified as UTF-8.

    At the time of writing, not all browsers do this, so you should not rely on all readers of your page benefitting from this just yet.

    Previous versions of Internet Explorer gave the BOM precedence over HTTP, but IE10 and IE11 give a higher precedence to HTTP. It is hoped that the next version of Internet Explorer will revert to the previous behaviour, which will then be in line with the other major browsers.

    In browsers where the HTTP header still overrides the byte-order mark and the server is declaring pages to have a non-Unicode character encoding, you are likely to find unexpected characters at the start of the page (such as  in a page labelled in HTTP as ISO 8859-1) as well as problems displaying non-ASCII characters on the page.


    http://www.w3.org/International/questions/qa-byte-order-mark


    A documentação informa que recentemente isso tem sido alterado na especificação HTML5 para que BOM sobrescreva qualquer declaração de cabeçalho HTTP quando declarado na página, mas informa também que nem todos os browsers fazem isso.

    Então pode-se concluir que a alternativa A esta correta.