encoding and saving of strange charaters

Discussion in 'ASP .Net' started by Amil, Feb 7, 2006.

  1. Amil

    Amil Guest

    I am screen scraping a web page via GetResponseStream and can't resave a
    certain character in the stream:

    Stream respStream = wResp.GetResponseStream();
    StreamReader reader = new StreamReader(respStream, Encoding.ASCII); // have
    also used other UTFx modes
    String respHTML = reader.ReadToEnd();

    There is a strange character on the web page; it is a extra long
    hypen...like the one in MS Word that is used if you type in two normal
    hypens. I read the character in and try to resave it to another HTML
    file...but when I view the HTML file now, it just contains several non-ascii
    characters.

    Any idea how to preserse the strange characters? I don't know if things are
    going amiss during the read or during the write of the new file (maybe the
    new file and it only supports asii).

    Any ideas?

    Amil
     
    Amil, Feb 7, 2006
    #1
    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. Zsolt Koppany
    Replies:
    0
    Views:
    521
    Zsolt Koppany
    Nov 27, 2003
  2. Replies:
    2
    Views:
    5,556
    Ian Collins
    Jan 19, 2006
  3. Replies:
    5
    Views:
    399
    Larry Bates
    Sep 24, 2007
  4. Dave Angel
    Replies:
    9
    Views:
    337
    Wolfgang Rohdewald
    Jun 17, 2009
  5. Robert Keller

    gsub question on special charaters

    Robert Keller, Nov 20, 2007, in forum: Ruby
    Replies:
    3
    Views:
    112
    Robert Keller
    Nov 20, 2007
Loading...

Share This Page