Thomas 'PointedEars' Lahn wrote:
> Bart Van der Donck wrote:
>> Character encoding in message boxes or web pages are two totally
>> different things.
>
> Not true.
It is true, because the character encoding is done at a different
level. Message boxes -like in this example- are actually much easier.
There can only be one possible representation. But when trying to
write y-umlaut in a web page, you have a bunch of possibilities, on
the top of my head, at least 10 - for which of course some are more
preferred than others.
>>> * * *alert( 'the following char is ASCII FF: \xff. So what does it
>>> look like to you?' );
>
>> This always looks the same for everyone, namely a y with an umlaut on.
> > No other display is possible here.
>
> You are mistaken. *The \x string literal escape sequence may or may not
> specify a Unicode character, depending on the ECMAScript implementation.
But I was only saying that alert('\xff') always shows y-umlaut in any
browser. y-umlaut is the character that is tied to code point 255 in
any ECMAScript implementation.
>>> * *<meta http-equiv='Content-Type' content='text/html; charset=Big5-
>>> HKSCS'>
>
> That line does not affect javascript's internal code point table (like
>> eg. \xff).
>
> It could affect it if there was no corresponding HTTP header present that
> says otherwise. *
Untrue. The display of \x.. (and \u....) can never be influenced by
any HTTP-header. The notation is ASCII-safe, and is passed to the
javascript engine to tie it to a fixed character. I think you're
mixing up the character set of a web page with javascript's consistent
internal code point table.
> There is no "javascript", BTW.
Is that so.
>> It defines which character set must be used on the web page.
>
> Unless a corresponding HTTP header is present that says otherwise.
That is far from sure, and could easily vary from browser to browser.
Anyway - it would be unwise to specify a charset on the web page that
contradicts the HTTP header (coder's fault, not browser's fault).
> There are no "web pages", BTW.
Is that so
--
Bart