Character encoding

Discussion in 'ASP General' started by SalamElias, Jan 21, 2005.

  1. SalamElias

    SalamElias Guest

    Hi,
    I have a partner sending me by post method to an asp page some text (xml
    string).
    It arrives to my page encoded as follows
    %9a%2f%Purchaseorder%3....f
    The < and > and spaces are replaced by nuùmbers and percentage sign
    I am using Request.BinaryRead(BytesTotal) and then doing response write and
    I am getting exactly the same string with the encoding
    How can tell my asp page to translate the encoded text to normal text?
    Than ks in advancs
    Salam
     
    SalamElias, Jan 21, 2005
    #1
    1. Advertising

  2. SalamElias wrote:


    > I have a partner sending me by post method to an asp page some text (xml
    > string).
    > It arrives to my page encoded as follows
    > %9a%2f%Purchaseorder%3....f
    > The < and > and spaces are replaced by nuùmbers and percentage sign
    > I am using Request.BinaryRead(BytesTotal) and then doing response write and
    > I am getting exactly the same string with the encoding
    > How can tell my asp page to translate the encoded text to normal text?


    It depends on the content type of the POSTed data, if it is text/xml or
    application/xml then you should simply be able to use MSXML e.g.
    Dim PostedXml, Loaded
    Set PostedXml = Server.CreateObject("Msxml2.DOMDocument.3.0")
    PostedXml.async = False
    Loaded = PostedXml.load(Request)
    If Loaded Then
    'use DOM to read out the content of nodes
    Else
    'handler PostedXml.ParseError
    End If

    If the posted data is posted as application/x-www-form-urlencoded (which
    what you have above looks like) then it should consist of
    paramname=paramvalue pairs and within ASP you can access
    Request.Form("paramname")
    and get the decoded value.

    If the data is posted with some made up format then you need to write
    your own decoder obviously.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 21, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harley

    foreign character encoding

    Harley, Jul 26, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,009
    Harley
    Jul 26, 2003
  2. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    18,930
    Jon Skeet [C# MVP]
    Jun 9, 2004
  3. Replies:
    1
    Views:
    23,438
    Real Gagnon
    Oct 8, 2004
  4. raavi
    Replies:
    2
    Views:
    917
    raavi
    Mar 2, 2006
  5. Replies:
    2
    Views:
    388
Loading...

Share This Page