473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to unescape HTML string

I have a simple question, is there an easy way in .NET
to unescape HTML characters?
for example I have a string

"Siebel Analytics Sr Consultant-"Partner w/ Deloitte & have
the oppty to become a Partner""

and I want to have

"Siebel Analytics Sr Consultant- Partner w/ Deloitte & have the oppty to
become a Partner"

Thank You
Aug 12 '06 #1
3 4797
"Sebastian Mark" <RE*********@terian.netschrieb:
>I have a simple question, is there an easy way in .NET
to unescape HTML characters?
for example I have a string

"Siebel Analytics Sr Consultant-&amp;quot;Partner w/ Deloitte &amp;amp;
have
the oppty to become a Partner&amp;quot;"

and I want to have

"Siebel Analytics Sr Consultant- Partner w/ Deloitte & have the oppty to
become a Partner"
Try 'HttpUtility.HtmlDecode'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 12 '06 #2
Try 'HttpUtility.HtmlDecode'.

Is there a specification somewhere of exactly what HtmlDecode does? The
documentatation is vague and cites some examples (space, lt, gt). I would
like to know exactly what it does.

Aug 12 '06 #3
AMercer wrote:
>Try 'HttpUtility.HtmlDecode'.

Is there a specification somewhere of exactly what HtmlDecode does? The
documentatation is vague and cites some examples (space, lt, gt). I would
like to know exactly what it does.
Probably, but I couldn't find it, so I just got Reflector to tell me
what HtmlEncode does:

- characters after are encoded to &#number;
- " < & are encoded to &quot; &lt; &gt; &amp; respectively
- that seems to be it
--
Larry Lard
la*******@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version
Aug 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: parksch2 | last post by:
Does anyone know why unescape would throw an error on certain special characters? I'm trying to unescape the string: Espa%F1ol It shou8ld display like this after it is unescaped: Español
2
by: Pavils Jurjans | last post by:
Hello, I am looking fow C# equivalent of JavaScripts escape() and unescape() functions. I need to use C# function at the server side and then be able to use the opposite at the client side. ...
1
by: Harry Keck | last post by:
Is there a set of methods in the .Net framework that do the same thing as the jscript functions escape and unescape? I get very close with HttpUtility.UrlEncodeUnicode, but it puts "+" for...
30
by: mistral | last post by:
Neeed good javascript unescape encoder, to protect javascript code. Some advices? Online tool, or ready javascript only. Any opinions about the Javascript Obfuscator:...
3
by: Sebastian Mark | last post by:
I have a simple question, is there an easy way in .NET to unescape HTML characters? for example I have a string "Siebel Analytics Sr Consultant-&amp;quot;Partner w/ Deloitte &amp;amp; have the oppty to...
4
by: Rares Vernica | last post by:
Hi, How can I unescape HTML entities like "&nbsp;"? I know about xml.sax.saxutils.unescape() but it only deals with "&amp;", "&lt;", and "&gt;". Also, I know about htmlentitydefs.entitydefs, but not...
2
by: Richard Lewis Haggard | last post by:
Is it possible to use features from XmlDocument to unescape text back to its original raw text format after it has been escaped to handle non-HTML compliant character strings? I have code that...
1
by: Philipp | last post by:
How do I convert a string to escaped HTML? (Let's say I'm not using DOM.) E.g. "<p>foo</p>" would become "&lt;p&gt;foo&lt;/p&gt;"? Reversely, how do I unescape a string to be HTML? E.g. "&lt;em&gt;" would turn...
4
by: Robert Mark Bram | last post by:
Hi All, I have an application that is writing Javascript with JSP server side code that uses escapeXML: var someVar = "<c:out escapeXml="true" value="You'll never escape!"/ How to I...
1
by: RK | last post by:
Perhaps I'm confused somwhere in my understanding, but I'm trying to deal with some escaped text from an XML file which includes html markup and it appears there are a couple of techniques for...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.