XMLHTTP - trying to replace incorrect displayed chrs with the correct ones

Discussion in 'ASP General' started by Graham Mattingley, Nov 27, 2003.

  1. Hi Group,

    I have used xmlHTTP to grab a page from a server.. The page has the '£'
    symbol in it, when it get to my site it is displayed as a '?'.. I have tryed
    replace every way I know and it does not swap back..

    I have tryed replace "?" , "£"
    I have tryed chr(63) , chr(163)
    I have tryed "?" , £

    nothing works, except it does change the real '?' on the page, I mean the
    '?' that started out as '?' and not as '£'
    if I right a bit of code to count the '£' on the page it get the total right
    including the original '?' and the '?' that are supposed to be '£'.. I dont
    understand it I can count them by saying if {loopchr} = chr(63) but the the
    chr(63) does not work in a replace statement..

    I have examend the feed from theXMLHTTP and they are or seem to be got a '?'
    and yet I cant replace them..

    hope this makes sence

    thanks in advance

    Regards

    Graham
     
    Graham Mattingley, Nov 27, 2003
    #1
    1. Advertising

  2. Re: XMLHTTP - trying to replace incorrect displayed chrs with thecorrect ones

    Graham Mattingley wrote:

    > Hi Group,
    >
    > I have used xmlHTTP to grab a page from a server.. The page has the '£'
    > symbol in it, when it get to my site it is displayed as a '?'.. I have tryed
    > replace every way I know and it does not swap back..
    >
    > I have tryed replace "?" , "£"
    > I have tryed chr(63) , chr(163)
    > I have tryed "?" , £
    >
    > nothing works, except it does change the real '?' on the page, I mean the
    > '?' that started out as '?' and not as '£'
    > if I right a bit of code to count the '£' on the page it get the total right
    > including the original '?' and the '?' that are supposed to be '£'.. I dont
    > understand it I can count them by saying if {loopchr} = chr(63) but the the
    > chr(63) does not work in a replace statement..
    >
    > I have examend the feed from theXMLHTTP and they are or seem to be got a '?'
    > and yet I cant replace them..


    XMLHTTP is good at reading XML encoded as UTF-8 or UTF-16 however
    reading pages encoded otherwise leads to trouble when you use responseText.
    Thus you need to check what encoding the page has that you are trying to
    to read and maybe use an ADODB.Stream object to read the page as there
    you can set the encoding.
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Nov 27, 2003
    #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. Sullivan WxPyQtKinter
    Replies:
    1
    Views:
    423
    Tim Roberts
    Apr 7, 2006
  2. Rob Meade

    Coding correct/incorrect?

    Rob Meade, Dec 27, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    342
    Rob Meade
    Dec 28, 2006
  3. boney
    Replies:
    1
    Views:
    606
  4. yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

    yawnmoth, Nov 7, 2006, in forum: Javascript
    Replies:
    11
    Views:
    439
    Matt Kruse
    Nov 9, 2006
  5. Mike
    Replies:
    1
    Views:
    140
    Gregor Kofler
    Oct 2, 2008
Loading...

Share This Page