A
Al Reynolds
Afternoon,
In an earlier thread (http://tinyurl.com/5v4aa), I described a
problem I was having which was rather bizarrely solved by
changing the line:
"inputbox.value = numq+ag-cw-cc;"
to:
"inputbox.value = numq+(ag)-(cw)-(cc);"
This was needed in IE6 but not in any other browser I tried.
I have now solved the mystery of why inserting the brackets
removed the problem.
I used the age-old technique of removing everything else until
only the error remains. If you're interested in the two files
which eventually helped me to see the error, look at:
http://www.ex.ac.uk/cimt/dev/oddity/ie6-oddity-working.htm
http://www.ex.ac.uk/cimt/dev/oddity/ie6-oddity-faulty.htm
I will, however, explain the solution here.
IE6 is, I believe, the first version of the IE browser to have
"Auto-Select" for text encoding (character set) turned on by
default. When it loads the first of the above pages, it decides
that the encoding is "Western European (Windows)". When it
loads the second of the above pages, it decides that the
encoding is "Unicode (UTF-7)".
This process (and its arbitrary nature) is rather nicely illustrated
by the three examples below, which are all short. For full effect,
make sure you have Auto-Select turned on for text encoding if
you look at any of the web pages.
(1) http://www.ex.ac.uk/cimt/dev/oddity/plusminus-oddity-1.htm
<HTML>
<HEAD><TITLE>plus minus oddity 1</TITLE></HEAD>
<BODY>
foo+stuff-bar
</BODY>
</HTML>
This displays:
foo<oriental symbol>bar.
IE has decided that the document is Unicode (UTF-7).
(2) http://www.ex.ac.uk/cimt/dev/oddity/plusminus-oddity-2.htm
<HTML>
<HEAD><TITLE>plus minus oddity 2</TITLE></HEAD>
<BODY>
foo+stuff-bar<BR>
foo+ stuff -bar
</BODY>
</HTML>
This displays:
foo+stuff-bar
foo+ stuff -bar
IE has decided that this document is Western European (Windows).
How it has decided this is unclear to me. It contains the same first
line as example (1), but something in the second line makes it change
its mind. Perhaps it is the appearance of "stuff" without the "+"
directly in front?
(3) http://www.ex.ac.uk/cimt/dev/oddity/plusminus-oddity-3.htm
<HTML>
<HEAD><TITLE>plus minus oddity</TITLE></HEAD>
<META HTTP-EQUIV="Content-Type"
CONTENT="text/html; CHARSET=iso-8859-1">
<BODY>
foo+stuff-bar
</BODY>
</HTML>
This displays:
foo+stuff-bar
IE has correctly responded to my suggestion that this document is in
Western European (ISO) as specified in the META tag.
I'm sure that some of you will tell me that I should have always set
the character set for every HTML page I have ever written. If I had
done then I might never have discovered this IE6 "feature".
Anyway, I have learnt my lesson.
I can see two potential ongoing problems. Firstly, it seems odd (to
me) that the text-encoding has also been used to process the script
within the page. There will be plenty of occasions where a variable
is enclosed between a "+" and a "-", and each of these could
potentially lead to an error. Do people script in non-latin charsets?
What makes the problem worse is that the way in which IE decides
the encoding depends fairly arbitrarily on things which appear *later*
in the code and/or page. Removing a working section of code might
remove the problem, but not because there was a fault in that section
of code.
Anyway, there is an easy solution.
Make sure the text-encoding is specified on every page.
Al
In an earlier thread (http://tinyurl.com/5v4aa), I described a
problem I was having which was rather bizarrely solved by
changing the line:
"inputbox.value = numq+ag-cw-cc;"
to:
"inputbox.value = numq+(ag)-(cw)-(cc);"
This was needed in IE6 but not in any other browser I tried.
I have now solved the mystery of why inserting the brackets
removed the problem.
I used the age-old technique of removing everything else until
only the error remains. If you're interested in the two files
which eventually helped me to see the error, look at:
http://www.ex.ac.uk/cimt/dev/oddity/ie6-oddity-working.htm
http://www.ex.ac.uk/cimt/dev/oddity/ie6-oddity-faulty.htm
I will, however, explain the solution here.
IE6 is, I believe, the first version of the IE browser to have
"Auto-Select" for text encoding (character set) turned on by
default. When it loads the first of the above pages, it decides
that the encoding is "Western European (Windows)". When it
loads the second of the above pages, it decides that the
encoding is "Unicode (UTF-7)".
This process (and its arbitrary nature) is rather nicely illustrated
by the three examples below, which are all short. For full effect,
make sure you have Auto-Select turned on for text encoding if
you look at any of the web pages.
(1) http://www.ex.ac.uk/cimt/dev/oddity/plusminus-oddity-1.htm
<HTML>
<HEAD><TITLE>plus minus oddity 1</TITLE></HEAD>
<BODY>
foo+stuff-bar
</BODY>
</HTML>
This displays:
foo<oriental symbol>bar.
IE has decided that the document is Unicode (UTF-7).
(2) http://www.ex.ac.uk/cimt/dev/oddity/plusminus-oddity-2.htm
<HTML>
<HEAD><TITLE>plus minus oddity 2</TITLE></HEAD>
<BODY>
foo+stuff-bar<BR>
foo+ stuff -bar
</BODY>
</HTML>
This displays:
foo+stuff-bar
foo+ stuff -bar
IE has decided that this document is Western European (Windows).
How it has decided this is unclear to me. It contains the same first
line as example (1), but something in the second line makes it change
its mind. Perhaps it is the appearance of "stuff" without the "+"
directly in front?
(3) http://www.ex.ac.uk/cimt/dev/oddity/plusminus-oddity-3.htm
<HTML>
<HEAD><TITLE>plus minus oddity</TITLE></HEAD>
<META HTTP-EQUIV="Content-Type"
CONTENT="text/html; CHARSET=iso-8859-1">
<BODY>
foo+stuff-bar
</BODY>
</HTML>
This displays:
foo+stuff-bar
IE has correctly responded to my suggestion that this document is in
Western European (ISO) as specified in the META tag.
I'm sure that some of you will tell me that I should have always set
the character set for every HTML page I have ever written. If I had
done then I might never have discovered this IE6 "feature".
Anyway, I have learnt my lesson.
I can see two potential ongoing problems. Firstly, it seems odd (to
me) that the text-encoding has also been used to process the script
within the page. There will be plenty of occasions where a variable
is enclosed between a "+" and a "-", and each of these could
potentially lead to an error. Do people script in non-latin charsets?
What makes the problem worse is that the way in which IE decides
the encoding depends fairly arbitrarily on things which appear *later*
in the code and/or page. Removing a working section of code might
remove the problem, but not because there was a fault in that section
of code.
Anyway, there is an easy solution.
Make sure the text-encoding is specified on every page.
Al