G
Guest
Hi...
Have another thread going on in scripting.jscript trying to work around some
deficiencies in the way IE and IIS interact.
The nub of it is this: ASP.Net explicitly sets an output encoding header
which IE seems to want to ignore most of the time. At the same time, ASP.Net
emits a properly encoded stream *but* doesn't output the BOM on utf-* output
which IE would use and respect if it had it.
We already derive a lot of things from System.Web.UI.Page, and I was
wondering if there was any combination of properties that could be overridden
so that when the page's encoding settings are made/changed we could take a
look and output a BOM if it's utf-*? I looked at Page.ResponseEncoding
(string, doesn't appear virtual), Page.CodePage (int, doesn't appear
virtual), etc. Didn't see anything that would be easy to grab onto that
would control the interaction.
To give a little more detail, we found that (by the usual default) our
ASP.Net pages output utf-8. We're also serving client-side script via an
aspx page. The output is properly-encoded utf-8 and the ; charset=utf-8
header is right, but when the client-side script is executed, IE is ignoring
that and interpreting the script in latin1, so accented characters in string
literals are coming out as a lot of A-enyas and copyright symbols.
I found that if the output stream included the BOM, IE was smarter and
interpreted the script right. I'm trying to implement a more rigorous answer
- insert some handling so that I can tell when a Page encoding is being set I
can output the BOM when it's utf-*.
Still a little perplexed why ASP.Net and IE aren't playing better with each
other, but Firefox doesn't need the BOM for extra help. Having the BOM
doesn't appear to hurt Firefox, though, so it seems like a decent work-around.
Thanks
Mark
Have another thread going on in scripting.jscript trying to work around some
deficiencies in the way IE and IIS interact.
The nub of it is this: ASP.Net explicitly sets an output encoding header
which IE seems to want to ignore most of the time. At the same time, ASP.Net
emits a properly encoded stream *but* doesn't output the BOM on utf-* output
which IE would use and respect if it had it.
We already derive a lot of things from System.Web.UI.Page, and I was
wondering if there was any combination of properties that could be overridden
so that when the page's encoding settings are made/changed we could take a
look and output a BOM if it's utf-*? I looked at Page.ResponseEncoding
(string, doesn't appear virtual), Page.CodePage (int, doesn't appear
virtual), etc. Didn't see anything that would be easy to grab onto that
would control the interaction.
To give a little more detail, we found that (by the usual default) our
ASP.Net pages output utf-8. We're also serving client-side script via an
aspx page. The output is properly-encoded utf-8 and the ; charset=utf-8
header is right, but when the client-side script is executed, IE is ignoring
that and interpreting the script in latin1, so accented characters in string
literals are coming out as a lot of A-enyas and copyright symbols.
I found that if the output stream included the BOM, IE was smarter and
interpreted the script right. I'm trying to implement a more rigorous answer
- insert some handling so that I can tell when a Page encoding is being set I
can output the BOM when it's utf-*.
Still a little perplexed why ASP.Net and IE aren't playing better with each
other, but Firefox doesn't need the BOM for extra help. Having the BOM
doesn't appear to hurt Firefox, though, so it seems like a decent work-around.
Thanks
Mark