Store in a file a web page written in chinese

Discussion in 'ASP .Net' started by Antonio, Oct 21, 2004.

  1. Antonio

    Antonio Guest

    Hi,
    I want to read an html page written in chinese and store it in a file
    having extension .aspx , I'm not sure where is the problem, I use the
    following lines of code:

    String sAddress = "http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_zh&trurl=http://www.etantonio.it/EN/index.aspx"
    ;

    WebRequest req = WebRequest.Create(sAddress);
    WebResponse result = req.GetResponse();
    Stream ReceiveStream = result.GetResponseStream();
    StreamReader reader = new StreamReader(ReceiveStream, Encoding.UTF8 );
    String sHtmlTradotto = reader.ReadToEnd();

    StreamWriter writer = new StreamWriter( "prova.aspx" , false,
    System.Text.Encoding.UTF8) ;

    writer.Write(sHtmlTradotto);
    writer.Flush();
    writer.Close();

    But the file produced didn't contain the chinese characters so, how
    can I solve the problem???

    Many Thanks in advance ...

    Ing. Antonio D'Ottavio
    Antonio, Oct 21, 2004
    #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. Antonio
    Replies:
    0
    Views:
    359
    Antonio
    Oct 25, 2004
  2. John Toop
    Replies:
    0
    Views:
    398
    John Toop
    Jul 21, 2003
  3. Steve C. Orr, MCSD
    Replies:
    1
    Views:
    555
    reaway lee
    Aug 24, 2003
  4. Lew
    Replies:
    63
    Views:
    1,393
    Arne Vajhøj
    May 27, 2010
  5. KaiWen
    Replies:
    102
    Views:
    2,701
    Jorgen Grahn
    Sep 15, 2011
Loading...

Share This Page