Tagged Questions
21
votes
3answers
15k views
10
votes
7answers
2k views
Inverse htmlentities / html_entity_decode
Basically I want to turn a string like this:
<code> <div> blabla </div> </code>
into this:
<code> <div> blabla </div> ...
9
votes
2answers
11k views
html_entity_decode problem in PHP?
I am trying to convert HTML entities from a source string to their literal character equivalent.
For example:
<?php
$string = "Hello – World";
$converted = ...
7
votes
4answers
5k views
Converting HTML entities to Unicode Characters in C#
I found similar questions and answers for Python and Javascript, but not for C# or any other WinRT compatible language.
The reason I think I need it, is because I'm displaying text I get from ...
7
votes
1answer
10k views
How to decode HTML entities in Rails 3? [duplicate]
Possible Duplicate:
How do I encode/decode HTML entities in Ruby?
I would like to convert strings like this:
"I'm working"
to
"I'm working"
(i.e. decode HTML entities)
What ...
6
votes
3answers
10k views
Does html_entity_decode replaces also? If not how to replace it?
I have a situation where I am passing a string to a function. I want to convert to " " (a blank space) before passing it to function. Does html_entity_decode does it?
If not how to do ...
4
votes
1answer
274 views
Why are HtmlEncode and HtmlDecode not isomorphic in .NET?
I find this surprising, and rather annoying.
Example:
Decode(”) => ”
Encode(”) => ”
Relevant classes:
.NET 4: System.Net.WebUtility
.NET 3.5: System.Web.HttpUtility
I ...
4
votes
5answers
2k views
Correct PHP method to store special chars in MySQL DB
Using PHP, what is the best way to store special characters (like the following) in a MSQUL database, to avoid injections.
« " ' é à ù
This is how I do it now:
$book_text=$_POST['book_text'];
...
3
votes
3answers
8k views
php htmlentities to decode textarea
I have a text area and I would like to take the input of the text area and merge it all together. Everything works fine except that it's escaping the quotes. For example test's is outputted as test/'s
...
3
votes
3answers
2k views
How to get MVC model strings as plain text in views
I'm sending a model to a view that have strings. Those strings are html encoded and I do not need them to be. Any way to send a model to a view without html encoding?
Model:
public class Package
{
...
2
votes
1answer
329 views
Content type vs HTML encoding
I'm bulding a site and I've set its content type to use charset UTF-8. I'm also using HTML encoding for the special characters, ie: instead of having á I've got á.
Now I wonder (still ...
2
votes
4answers
91 views
CSS put html entity as content [duplicate]
Using the css content property, I am trying to make put an HTML entity after an element.
Here is my HTML:
<table id="tic" cellpadding="0" cellspacing="0" border="5" bordercolor="black" ...
2
votes
1answer
1k views
Why isn't PHP's htmlentities() converting the œ character?
I'm having some trouble with PHP's htmlentities() / htmlspecialchars() functions. The string I am converting contains the character œ (html equivalent is '&oelig'), yet both htmlentities() and ...
2
votes
2answers
613 views
PHP: html_entity_decode removing/not showing character
I am having a problem with  character on my website.
I have a website where users can use a wysiwyg editor (ckeditor) to fill out their profile. The content is ran through htmlpurify before ...
2
votes
2answers
67 views
Django: extra HTML character escape in attributes as recommended by OWASP
Django escapes these characters : & < > " ', which is sufficient for inserting data in HTML elements. However if you want to set untrusted data in attributes, OWASP recommends escaping a lot ...
2
votes
1answer
220 views
Getting back HTML from `div` element using jQuery
When I add HTML to a div element and later try to get it back, jQuery either removes the HTML tags or converts all applicable characters to HTML entities, depending on if I use .html() or .text().
...
1
vote
3answers
1k views
PHP htmlentities and saving the data in xml format
Im trying to save some data into a xml file using the following PHP script:
<?php
$string = '<a href="google.com/maps">Go to google maps</a> and some special characters ë è & ä ...
1
vote
2answers
395 views
How can I convert HTML to plain text in CakePHP?
I’m making a little forum engine on CakePHP based more or less on phpBB.
So, when somebody posts a message, they enter the text in a textarea, and on a beforeSave(), among other actions, the system ...
1
vote
1answer
125 views
Custom HtmlEncode with HTML entity name, is it possible?
I am using the following method to HtmlEncode some text that it's in spanish like this:
string word = "configuración";
string encodedWord = System.Net.WebUtility.HtmlEncode(word);
The output is the ...
1
vote
1answer
2k views
How to display both single and double quotes in textbox or textarea
In the database, the data string has both single and double quotes in them.
Data string.
A'B"C
When it's displayed in a textbox or textarea, it's automatically encoded to html entities.
Code in ...
1
vote
0answers
558 views
ASP.NET/.NET: Method to determine whether string is or contains HTML entity
Is there a method anywhere in the .NET framework or System.Web that will tell me whether a string contains an HTML or is one?
Should I just Server.HtmlEncode(myString) and see if its length is longer ...
0
votes
4answers
1k views
What Are The Reserved Characters In (X)HTML?
Yes, I've googled it, and surprisingly got confusing answers.
One page says that < > & " are the only reserved characters in (X)HTML. No doubt, this makes sense.
This page says < > ...
0
votes
1answer
89 views
Php html is printing as it is on the page
I have and html string like this :
&lt;div class="short-description"&gt; &lt;h2&gt;&lt;/h2&gt; ...
0
votes
3answers
405 views
Getting char value in Delphi 7
I am making a program in Delphi 7, that is supposed to encode a unicode string into html entity string.
For example, "ABCģķī" would result in "ABCģķī"
Now 2 basic things:
...
0
votes
2answers
286 views
decode and encode HTML from php htmlentities in real time using jQuery
Well this is the problem, i have a "pre" tag with encoded html using htmlentities() from php that shows correctly on website.
But then i want to redecode it to put it in a "textarea" to work with in ...
0
votes
1answer
299 views
How to force CKEditor to use HTML Numbers instead of special Characters
How can I force CKEditor to automatically convert special Characters to HTML Numbers?
For example when I write 6% in the editor and then look at the source code I get <p>6%</p> but what ...
0
votes
2answers
244 views
Change htmlentities in mysql
I have entries in a mysql database that have htmlentities, so, e.g., ö instead of ö.
Now I realized that for the next things I have to do with that database, I will have to get rid of all ...
0
votes
1answer
980 views
Html entities back to special characters with php
I want to convert special characters to HTML entities, and then back to the original characters.
I have used htmlentities() and then html_entity_decode(). It worked fine for me, but { and } do not ...
0
votes
4answers
226 views
Confused regarding form protection (HTML, PHP)
this will be so easy for someone. I just spent 6 hours reading and I feel really stupid right now but hey... I'm learning so I thought - I'll ask you guys! I've seen some excellent examples on here ...
0
votes
1answer
30 views
Laravel html_entity_decode using UTF-8
I am using Laravel 4, with PHP and MySQL.
Everything is in UTF-8
I have blog titles stored in my database, that look like :
This is an "example" post title
Now on my website, I have images using ...
0
votes
2answers
574 views
Decode HTML entities with Regex
I've a large amount of encoded text, like this:
<div id="readingPaneContentContainer" class="ClearBoth" cmp="cmp" ...
0
votes
1answer
797 views
HTMLEntities vs. URI.escape for decoding a string in Ruby
BACKGROUND: I am looking to decode strings that include HTML entities - i.e. "c#" should be converted to "c%23".
I have found the HTMLEntities project to be generally recommended, but have also ...
0
votes
1answer
2k views
php not encoding em dash (among other things correctly);
I have a small JSON object that I'd like to send to php to put in a mySQL database. Part of the information in the string is html entities. &emdash is giving me problems. It is showing up as â€. ...
0
votes
1answer
72 views
jQuery / JS and HTML entity decoding.
I've got this HTML entity I need to use as the title attribute and href attribute on a link (–) how do I escape/decode this for use? I'm using jQuery, do either a vanilla jS or jQuery method ...
0
votes
0answers
117 views
display tag export to excel option changing & to & amp
I am writing an application where a search returns results in a table format. This is done using display tags and they work fine until now.
When i click on the export option: "excel", some ...
0
votes
1answer
97 views
Htmlentities Encode and specific Decode
I create a blog where people can be create a post with scripts code.
So i pass the post string in htmlentities($string) during upload and save it into database. Now, this work but only with scripts ...
0
votes
1answer
39 views
Why are there two different HTML entities formats and what is their difference?
When I was encoding some text to HTML entities, I noticed there were two formats. For example, the string
ç á ê
can get encoded to
ç á ê
or
ç á ...
0
votes
1answer
226 views
Rich Text Message Conversion - php
Ok, I have been pulling my hair out with various encode/decode, and htmlentities(), and have yst to find a solution. I am processing emails. Some emails are like the following:
That change is ...
0
votes
2answers
298 views
How to decode all entities except html entities
I have a string that has special letters like "á" and htmlcode like "<input type='text' />". When I store this string in my DB I use: htmlentities($string, ENT_QUOTES);.
The problem is when I ...
0
votes
0answers
261 views
php: remove html entities [duplicate]
Possible Duplicate:
How to remove html special chars?
What is the best way to remove all html entities from a string? I do not want to decode them, I simply want them removed.
Similar ...
0
votes
3answers
1k views
Best way to find illegal characters in a bunch of ISO-889-1 web pages?
I have a bunch of html files in a site that were created in the year 2000 and have been maintained to this day. We've recently began an effort to replace illegal characters with their html entities. ...
-1
votes
1answer
36 views
html_entity_decode and HTML <textarea> tag
I am using html_entity_decode to display proper html when retrieved from the database.
So suppose i have
$data = '<b> Hello </b>'
$data = html_entity_decode($data);
// outputs Hello ...