Re: different encoding handling between old ASP and ASP.Net
- From: "Joerg Jooss" <news-reply@xxxxxxxxxxxxx>
- Date: Wed, 08 Jun 2005 14:19:29 -0700
Mark wrote:
> Hi Joerg...
>
> Actually, none of the vaporized characters in the original example
> are prohibited from utf-8 per se; what was broken about the original
> example was that %C7 was followed by %D1; to be legal utf-8, it
> would have to have been followed by %BF or lower.
Yep -- I was talking about bytes, not characters.
> Taken together, the example string that was supposed to be utf-8 *as
> a whole* is invalid, and the question was more about what's the
> appropriate way to respond ot that. ASP responded to an invalid
> utf-8 string by not trying to find valid bits in it but by giving as
> close to a "raw" approximation as it could.
>
> ASP.Net treats it like panning for gold. It sifts through the stream
> until it finds byte combos that are legal, keeps those, and drops the
> rest. It doesn't even put in ? as a placeholder, like so many of the
> other apis do. I don't see how that's any less "wrong" than what ASP
> does.
As I pointed put, replacement characters are misleading, because you
have no idea whether the '?' is genuine or a replacement.
What we really need here is a HttpRequest property that indicates
whether form data or the query string were decoded without skipping
input bytes.
Cheers,
--
http://www.joergjooss.de
mailto:news-reply@xxxxxxxxxxxxx
.
- References:
- Prev by Date: How to work with graphics in ASP.NET?
- Next by Date: Format text from db into HTML text
- Previous by thread: Re: different encoding handling between old ASP and ASP.Net
- Next by thread: Having trouble getting at the value of a Session variable
- Index(es):
Relevant Pages
|