473,406 Members | 2,745 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,406 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 4702
"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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.