Re: Error decoded 8 bit characters.

From: Joerg Jooss (joerg.jooss_at_gmx.net)
Date: 04/11/04


Date: Sun, 11 Apr 2004 11:19:24 +0200

T Conti wrote:
> Hello:
>
> We ran into an issue with the decoding 8 bit characters. We have an
> asp page that makes a call to an ashx page. When the HTTPHandler
> accesses the query string we find that the 8 bit characters are
> stripped. The source asp page is encoding using ISO-Western European
> (windows-1252) single byte encoding. I am assuming that the .Net
> framework uses the Unicode (UTF8) as the basis for decoding the URL.
> Now we managed to get this to work by explicitly requesting that the
> HTTPHandler use Windows-1252 for encoding/decoding:
>
> <globalization
> requestEncoding="Windows-1252"
> responseEncoding="Windows-1252"/>
>
> This works when the URL is passed using a single byte encoding but it
> breaks when multi-byte encoding on the URL is used by the source page.
> SO the solution is not extensible. This brings up a few questions:
>
> 1) Is there a way to programatically indicate the responseEncoding
> using an aspx page.

Yes. You can set the property HttpResponse.ContentEncoding.

> 2) Has anyone had luck with a more flexible approach to handling the
> encoding/decoding of characters w/o have in to hard code the encoding
> in the web.config.

On general: if your clients are properly communicating the appropriate
encoding, you can retrieve that value from the HTTP request and apply it. If
they don't, you're out of luck.

Cheers,

-- 
Joerg Jooss
joerg.jooss@gmx.net


Relevant Pages

  • Re: different encoding handling between old ASP and ASP.Net
    ... none of the vaporized characters in the original example are ... prohibited from utf-8 per se; what was broken about the original example was ... don't see how that's any less "wrong" than what ASP does. ... throw an invalid format exception when garbarge is fed to an Encoding class. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Lisp version of a Cism
    ... >> enumerate the characters. ... > to the encoding IT uses. ... > characters to numbers. ... We're not decoding bytes from files, ...
    (comp.lang.lisp)
  • Error decoded 8 bit characters.
    ... We ran into an issue with the decoding 8 bit characters. ... The source asp page is encoding using ISO-Western European ... HTTPHandler use Windows-1252 for encoding/decoding: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Encoded chars from form post
    ... FileSystemObject) that contains special characters like יטא... ... > We have an asp application which we are building in unicode support. ... > select encoding in IE). ... > (including for example chinese characters) inside the asp file. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Addon: Type conversion question
    ... To translate to/from bytes you need to use the correct Encoding or characters will get translated wrong as well as decoding a 16-bit Unicode encoded byte array using a 7-bit ASCII encoding won't give much useful information. ...
    (microsoft.public.dotnet.languages.csharp)

Loading