Re: First stupid post of the year. [SOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 6 Jan 2008 11:28:55 -0500, tedd wrote:

> At 11:04 PM +0100 1/5/08, Nisse Engström wrote:
>>
>>    The page encoding is determined by the HTTP
>>`Content-Type:´ header. Period. A <meta> element
>>may provide hints to a browser if the HTTP header
>>is missing (eg. when saving a page to disc). In the
>>presence of a `Content-Type:´ header, the <meta>
>>element should be completely ignored.
> 
> So, if one uses this --
> 
> <?php header('Content-Type: text/css; charset=UTF-8'); ?>

[text/html ?]

> -- preceding everything else on a web page, and 
> also saves that page using UTF-8 encoding, then 
> it's certain that the page will be recognized as 
> UTF-8 across all modern browsers?

   I don't know if there is any certainty. If you want
absolute certainty, plain ASCII with character references
(`&Auml;´, `&#x201d´ and so on) may be the way to go.
And even then, all character references might not be
supported by the browser...

>>  > And lastly, what's the best encoding to set your
>>>  browser? I have clients who are all over the
>>>  place with special windoze characters that appear
>>>  like garbage in my browser.
>>
>>    Set it to detect automatically, with a preference
>>for cp1252 (or windows-1252) which covers a lot of
>>western characters. cp1252 also has the nice property
>>of being compatible with ISO-8859-1, except that it
>>has some extra real characters where 8859-1 has control
>>characters.
> 
> Interesting that my browser (Safari) doesn't even 
> offer that choice, at least under that name. It 
> does offer ISO Latin, Mac OS Roman, UTF-8, and 34 
> other language-specific text encodings -- but not 
> 1252.

[The proper name is `windows-1252´.]

How does the following pages compare? The display
should be identical:

<http://luden.se/test/t-1252.html>
<http://luden.se/test/t-utf8.html>


/Nisse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux