What charset the IIS uses to decode POST request?

Ask a Question related to ASP, Design and Development.

  1. #1

    Default What charset the IIS uses to decode POST request?

    Hallo,

    I am working on multilingual web-application, and I have to be very sure
    about how the international characters are encoded and decoded in the
    client-server form requests.

    There's a great article about the issue:
    [url]http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html[/url]

    Generally, that states that this are is filled with landmines. From my tests
    I see that form content upon POST request is encoded using the character
    encoding from the html page that hosted the form. However, there is no
    information about the used codepage in the POST request, and the server side
    has somehow to guess it so that it can decode the data properly and populate
    the Request.Form collection. My tests show that if the requester page is
    plain html with utf-8 codepage Content-Type metatag, the serverside
    sometimes does, but most time fails to decode the characters properly.

    So, my question is, what codepage is used when interpreting and decoding the
    POST request data anf Request.Form collection is populated? I cuold write my
    own interpreter that takes the data out from Request.BinaryRead(), but I
    would prefer to use the default Request.Form collection tough.

    Thanks,


    -- Pavils


    Pavils Jurjans Guest

  2. Similar Questions and Discussions

    1. Help regarding HTTP::Request:POST
      Hi All: I'm facing an issue with the HTTP::Request:POST function. My Code is trying to post some content to other applications and should get an...
    2. Request: What property will be unique with every post?
      I am looking for a property of the System.Web.HttpRequest class that will always be different. Is there a property that uniquely identifies each...
    3. 400 Bad Request using LWP::UserAgent and POST
      Hi, I am working on a script to automatically upload files to my account on Yahoo. It logs in, retrieves the form for uploading files, but when...
    4. RPC Unavailable using HTTP post request
      I have a .NET web srvc which internally uses DCOM to connect a remote activex exe. This works fine from clients provided connctions are made via...
    5. How do I POST a multipart request?
      Hello I am writing a script to send a POST request to a webserver. The request consists of the following: POST /someurl/servlets/SomeServlet ...
  3. #2

    Default Re: What charset the IIS uses to decode POST request?

    My sympathies. You may have noticed my posts on this question, and also the
    lack of any response. Yes, that link has a super discussion of the issue.

    The route I took was to end-run the problem by converting the input at POST
    time to 7-bit-safe stuff, filled into a hidden field. In addition to a
    database record of the input, I was trying to generate data for an RTF file
    as a possible output, and while the database contents were handled correctly
    in both directions, I could find nothing on its format for purposes of
    converting to the "hex Unicode" Code-page format that RTF requires.

    That is, a two-byte UTF-8 Cyrillic character was converted to a 4-byte
    value, and I couldn't discern the conversion algorithm. I expect it's
    related to a double conversion. A couple of cuts at reverse-engineering
    failed. If you succeed, pls share the solution.

    FYI, I used the Javascript charCodeAt() function for the client-side
    conversion. HTH a bit more than just sympathy.

    AS


    Arnold Shore Guest

  4. #3

    Default Re: What charset the IIS uses to decode POST request?

    Hi, Pavils

    ASP uses ANSI code page to decode source data. You have to explicitly
    specify utf-8 code page to work correctly with form data:
    <%@ Codepage=65001 %>

    BTW. I worked a lot of time to create component working with form-data,
    any code page, accepting up to 2GB of multipart and url-encoded form data
    (Request.Form has a 100kB limit). You can find it at [url]http://www.pstruh.cz[/url]
    (Huge-ASP upload)

    Antonin


    "Pavils Jurjans" <pavils@mailbox.riga.lv> wrote in message
    news:#ixndZTmDHA.1960@TK2MSFTNGP12.phx.gbl...
    > Hallo,
    >
    > I am working on multilingual web-application, and I have to be very sure
    > about how the international characters are encoded and decoded in the
    > client-server form requests.
    >
    > There's a great article about the issue:
    > [url]http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html[/url]
    >
    > Generally, that states that this are is filled with landmines. From my
    tests
    > I see that form content upon POST request is encoded using the character
    > encoding from the html page that hosted the form. However, there is no
    > information about the used codepage in the POST request, and the server
    side
    > has somehow to guess it so that it can decode the data properly and
    populate
    > the Request.Form collection. My tests show that if the requester page is
    > plain html with utf-8 codepage Content-Type metatag, the serverside
    > sometimes does, but most time fails to decode the characters properly.
    >
    > So, my question is, what codepage is used when interpreting and decoding
    the
    > POST request data anf Request.Form collection is populated? I cuold write
    my
    > own interpreter that takes the data out from Request.BinaryRead(), but I
    > would prefer to use the default Request.Form collection tough.
    >
    > Thanks,
    >
    >
    > -- Pavils
    >
    >

    Antonin Foller Guest

  5. #4

    Default Re: What charset the IIS uses to decode POST request?

    Thanks, Antonin,

    This bit of info was the last one to complete my puzzle. Now I'm happy (tm).

    Yes, I know of your site and the great components you have made. In this
    case, I am looking for more tech insight on the POST format problems. I have
    my own pure-ASP upload in JScript working very fine, and I prefer to stay
    with pure code class, because then I have full control of what happens
    inside.

    Regards,

    -- Pavils

    "Antonin Foller" <antonin@foller.cz> wrote in message
    news:uda98ZYmDHA.684@TK2MSFTNGP09.phx.gbl...
    > Hi, Pavils
    >
    > ASP uses ANSI code page to decode source data. You have to explicitly
    > specify utf-8 code page to work correctly with form data:
    > <%@ Codepage=65001 %>
    >
    > BTW. I worked a lot of time to create component working with
    form-data,
    > any code page, accepting up to 2GB of multipart and url-encoded form data
    > (Request.Form has a 100kB limit). You can find it at [url]http://www.pstruh.cz[/url]
    > (Huge-ASP upload)
    >
    > Antonin

    Pavils Jurjans Guest

  6. #5

    Default Re: What charset the IIS uses to decode POST request?

    Arnold, I think I may help you with your issues. Just make you contactable,
    mail me or ICQ: 4047612

    -- Pavils

    "Arnold Shore" <dont@bother.me> wrote in message
    news:%23jYeQPYmDHA.1244@TK2MSFTNGP11.phx.gbl...
    > My sympathies. You may have noticed my posts on this question, and also
    the
    > lack of any response. Yes, that link has a super discussion of the issue.
    >
    > The route I took was to end-run the problem by converting the input at
    POST
    > time to 7-bit-safe stuff, filled into a hidden field. In addition to a
    > database record of the input, I was trying to generate data for an RTF
    file
    > as a possible output, and while the database contents were handled
    correctly
    > in both directions, I could find nothing on its format for purposes of
    > converting to the "hex Unicode" Code-page format that RTF requires.
    >
    > That is, a two-byte UTF-8 Cyrillic character was converted to a 4-byte
    > value, and I couldn't discern the conversion algorithm. I expect it's
    > related to a double conversion. A couple of cuts at reverse-engineering
    > failed. If you succeed, pls share the solution.
    >
    > FYI, I used the Javascript charCodeAt() function for the client-side
    > conversion. HTH a bit more than just sympathy.
    >
    > AS
    >
    >

    Pavils Jurjans Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139