Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / April 2004

Tip: Looking for answers? Try searching our database.

bug in HttpWebRequest?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
z. f. - 28 Mar 2004 08:44 GMT
using HttpWebRequest to make HTTP request t web server and get resulting
HTML in the response, when the response includes hebrew characters (not
unicode) these characters are moved away after

StreamReader reader = new StreamReader ( response.GetResponseStream() );
strHTML = reader.ReadToEnd();

is there anyway to save all the data came with the response using this
object?

TIA.
Ianier Munoz - 28 Mar 2004 14:55 GMT
Try the following:
StreamReader reader = new StreamReader(response.GetResponseStream(),
response.ContentEncoding);
Hope it helps,
Signature

Ianier Munoz
http://www.chronotron.com

> using HttpWebRequest to make HTTP request t web server and get resulting
> HTML in the response, when the response includes hebrew characters (not
[quoted text clipped - 7 lines]
>
> TIA.
z. f. - 28 Mar 2004 17:02 GMT
thanx, it worked,
even though it worked with
System.Text.Encoding.GetEncoding( "windows-1255")
because response.ContentEncoding returns empty string.
(i checked the HTTP response headers, and it does not include encoding
information, the browser looks in the HTML META tag for that, and that what
i gave the StreamReader  class.)

> Try the following:
> StreamReader reader = new StreamReader(response.GetResponseStream(),
[quoted text clipped - 11 lines]
> >
> > TIA.
Feroze [MSFT] - 05 Apr 2004 03:58 GMT
If you look at my blog (given below), there is some code there which shows
you how to get the correct encodings. This will make sure that you dont lose
data.

Signature

feroze
http://weblogs.asp.net/feroze_daud
============

Remove "user" from the email address to reply to the author.

This posting is provided "AS IS" with no warranties, and confers no rights

Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> thanx, it worked,
> even though it worked with
[quoted text clipped - 19 lines]
> > >
> > > TIA.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.