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 / New Users / October 2004

Tip: Looking for answers? Try searching our database.

Should the output of HttpUtility.HtmlDecode() is the same as brows

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thana N. - 29 Oct 2004 05:44 GMT
Hi there!,

I've found that HttpUtility.HtmlDecode() will not decode   to space if the
input text is something like "<b>SKY CAPTAIN & THE WORLD OF&nbsp;</b>". The
output is the same as the input.  But output on browser is correct. Should
the output of HttpUtility.HtmlDecode() is the same as browser? Because I've
to rendor html to text as a browser does. So if HttpUtility.HtmlDecode() does
not do the same way as browser does, how should I do my job with FCL?

Thanks,
Thana N.
Nicole Calinoiu - 30 Oct 2004 13:28 GMT
That's because the string wasn't properly HTML-encoded in the first place.
The ampersand ("&") in the middle needs to be replaced by the "&amp;" known
entity.  i.e.:

<b>SKY CAPTAIN &amp; THE WORLD OF&nbsp;</b>

Once this is done, the string can be HTML-decoded properly to "<b>SKY
CAPTAIN & THE WORLD OF </b>".

BTW, the reason you were seeing the string you expected in the browser was
that the browser was being permissive of the invalid HTML.

HTH,
Nicole

> Hi there!,
>
[quoted text clipped - 10 lines]
> Thanks,
> Thana N.

Rate this thread:







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.