Tagged Questions
440
votes
7answers
187k views
Adding HTML entities using CSS content
How do you use the CSS content property to add html entities?
I have a number of links which I make into a breadcrumb style list by adding an arrow before each.
<div class="breadcrumbs">
...
69
votes
7answers
27k views
Infinity symbol with html
How can I display an infinity symbol (like the one in the picture) using HTML?
68
votes
6answers
229k views
What do < and > stand for?
I know what these entities are used for, but I am curious for where they stand for.
Does < stand for something like "Left tag" or is it just a code?
Maybe I can use the abbreviation as a ...
63
votes
8answers
6k views
When Should One Use HTML Entities
This has been confusing me for some time. With the advent of UTF-8 as the de-facto standard in web development I'm not sure in which situations I'm supposed to use the html entities and for which ones ...
27
votes
6answers
9k views
htmlentities in PHP but preserving html tags
I want to convert all texts in a string into html entities but preserving the HTML tags, for example this:
<p><font style="color:#FF0000">Camión español</font></p>
should be ...
23
votes
5answers
64k views
Convert HTML Character Back to Text Using Java Standard Library
I would like to convert some HTML characters back to text using Java Standard Library. I was wondering whether any library would achieve my purpose?
/**
* @param args the command line arguments
*/
...
22
votes
3answers
14k views
Convert HTML entities to Unicode and vice versa
Possible duplicates:
Convert XML/HTML Entities into Unicode String in Python
HTML Entity Codes to Text
How do you convert HTML entities to Unicode and vice versa in Python?
16
votes
1answer
15k views
Bigger version of •
Is there a bigger version of •?
• Right now it is this big
I want it this big without using font sizes or <li>
15
votes
5answers
7k views
Is there a faster way to decode html characters to a string than Html.fromHtml()?
I am using Html.fromHtml(STRING).toString() to convert a string that may or may not have html and/or html entities in it, to a plain text string.
This is pretty slow, I think my last calculation was ...
14
votes
5answers
8k views
Jsoup.clean without adding html entities
I'm cleaning some text from unwanted HTML tags (such as <script>) by using
String clean = Jsoup.clean(someInput, Whitelist.basicWithImages());
The problem is that it replaces for instance å ...
14
votes
2answers
543 views
Why doesn't Twitter and Google API documentation encode ampersands in URLs?
I have read I should encode my ampersands as & in HTML.
However numerous code samples from respected companies somehow forget to do this.
Just a few examples off the top of my head:
Google ...
13
votes
1answer
734 views
Using custom entities in HTML documents
tl;dr
I'd like to understand if it is possible (and, in case, how well supported) to use custom entities in HTML documents for localization purposes.
What I envision is doing something like this:
...
12
votes
1answer
3k views
What do the ENT_HTML5, ENT_HTML401, … modifiers on html_entity_decode do?
Since php 5.4 html_entity_decode introduces four new flags, with a minimal explanation
ENT_HTML401 Handle code as HTML 4.01.
ENT_XML1 Handle code as XML 1.
ENT_XHTML Handle code as XHTML.
...
11
votes
4answers
10k views
Does unicode or HTML have a vertical double guillemet (chevron)?
Does anybody know if there's a double chevron symbol in unicode/HTML-space similar to the double guillemet represented by » (»)?
In other words, I'm trying to avoid using an image if ...
10
votes
6answers
9k views
Stop TEXTAREA from decoding html entities
i have a strange problem :
In the database , in some column , asuming i have <div , whenever its printed INTO A TEXTAREA , the source code of the page shows like <textarea ...
9
votes
5answers
6k views
HTML character codes for this ▲ or this ▼
What are the HTML entity character codes for this up arrow (▲) and its downward-facing dog version (▼) ?
I've been using GIFs to represent these arrows since I don't know their codes.
8
votes
1answer
4k views
• doesn't work in IE?
Is that not an acceptable HTML code to use when designing pages? It renders correctly in Chrome, Safari, Firefox, Opera, etc... but IE literally outputs & bullet;
but even when I type the HTML ...
8
votes
4answers
1k views
PHP: Make a string upper case but not the html entities in it?
How can I make the content in a string to upper case but not the html entities in it? Is it possible?
$str = 'FUNDA MENTALISM';
echo strtoupper($str);
I want to produce this,
'FUNDA ...
8
votes
4answers
2k views
Should all accented characters use html entities?
I am working with a large number of HTML files that are mostly encoded as utf-8. There are accented characters galore as many are in French. I have been converting them to HTML entities as I go, but I ...
7
votes
2answers
12k views
URL/HTML Escaping/Encoding
I have always been confused with URL/HTML Encoding/Escaping. I am using PHP, so want to clear somethings up.
Can I say that I should always use
urlencode: for individual query string parts
$url ...
7
votes
3answers
16k views
How to Code Double Quotes via HTML Codes
In HTML, What is the preferred way to specify html codes like ", and what is the major differences? For example:
" <!-- friendly code -->
" <!-- numerical code -->
...
7
votes
5answers
11k views
Encode HTML entities but ignore HTML tags - in PHP
I have a string that might look like this
$str = "<p>Me & Mrs Jones <br /> live in <strong style="color:#FFF;">España</strong></p>";
...
7
votes
4answers
6k views
How to unescape apostrophes and such in Python?
I have a string with symbols like this:
'
That's an apostrophe apparently.
I tried saxutils.unescape() without any luck and tried urllib.unquote()
How can I decode this? Thanks!
6
votes
2answers
9k views
What is the difference between   and  ?
I have written one XSLT to transform xml to html. If input xml node contains only space then it inserts the space using following code.
<xsl:text> </xsl:text>
There is another ...
6
votes
1answer
4k views
How can I remove non-breaking spaces from a JSoup 'Document'?
How can I remove these:
<td> </td>
or
<td width="7%"> </td>
from my JSoup 'Document'? I've tried many methods, but these non-breaking space characters ...
6
votes
2answers
369 views
HTML character entity references for maximize and minimize
I was wondering is there anything like × for maximizing or minimizing ?
× outputs an X , likewise is there anything built in available for maximize and minimize ?
5
votes
3answers
4k views
Can I use unencoded ampersands (&) in html?
I'm building a website where I have to work with less then perfect masterdata (I guess I'm not the only one :-))
In my case I have to render an xml filte to html (using xsl). Sometimes the ...
5
votes
5answers
2k views
PHP: HTML Attribute Encoding / JavaScript Decoding
What's the proper way to encode untrusted data for HTML attribute context? For example:
<input type="hidden" value="<?php echo $data; ?>" />
I usually use htmlentities() or ...
5
votes
2answers
2k views
Optional line-breaking HTML entity that is always invisible
I want an optional line-breaking character that is always invisible that works with the word-wrap: break-word; CSS style.
Here are some specifics. My goal is to break apart long links in reasonable ...
5
votes
2answers
1k views
When escaping a string with HTML entities, can I safely skip encoding chars above Unicode 127 if I use UTF-8?
When outputting a string in HTML, one must escape special characters as HTML entities ("&<>" etc.) for understandable reasons.
I've examined two Java implementations of this:
...
5
votes
2answers
687 views
HTML Entities: When to Use Decimal vs. Hex
Is there a good rule of thumb for when to use decimal vs. hexadecimal notation for HTML entities?
For example, a non-breaking hyphen is written in decimal as ‑ and in hex as ‑.
...
5
votes
2answers
256 views
Why do HTML entity names with dec < 255 not require semicolon?
In a plain HTML document £ (dec 163) renders as £ without needing the ;, whereas &oelig (dec 339) will only render a œ with the semicolon. It seems that every html entity with a decimal ...
5
votes
4answers
1k views
Converting fractions to html entities
We've got some fraction information stored in the database, e.g. ¾ ½
Short of doing a search and replace, are there any inbuilt PHP functions that will automatically convert these to proper html ...
5
votes
2answers
4k views
Whats the deal with the named html entity for $ ($)
I have a fairly simple question. There is a named html entity in 'most' references for the dollar sign, and it is what you would expect it to be; '$'.
But in other references this is ...
5
votes
2answers
40 views
How do you tell a browser, “if you need to wrap, wrap here first”?
I'm producing a webpage where a header has a main subject and a descriptor, each of these are wrapped in tags.
I've looked up the <wbr> tag, and it only seems to work if you have long strings ...
5
votes
3answers
1k views
Disappearing HTML dingbat entities
I'm coming across a weird issue with displaying "dingbats" html entities, specifically ✔ (✔). I am trying to display some checkmarks, wrapped in a simple <span>:
<span ...
4
votes
3answers
4k views
whitespace html entity?
is there a corresponding html entity that represents a whitespace and like this '|_|'??
4
votes
2answers
4k views
HTML character entities and character encoding set
When including HTML entities in an HTML document, do the entities need to be from the same character encoding set that the document is specified to be using?
For example, if I am going to use the ...
4
votes
2answers
467 views
Why the HtmlEncode doesn't encode this char?
This is the code :
Response.Write("asd1 X : " + HttpUtility.HtmlEncode("×"));
Response.Write("asd2 X : " + HttpUtility.HtmlEncode("✖"));
The fist one is :
asd1 X : × // OK, ENCODED AS ...
4
votes
6answers
2k views
How to display XML source code using HTML with Emacs?
In the HTML file, I need to show some XML code. The problem is that I can't use
<pre>..</pre>
to show '<' and '>'.
What would be the solution for this problem?
ADDED
From the ...
4
votes
2answers
2k views
Is it not possible to use HTML entities in a title attribute?
The above screengrab is from Firefox. The cursor is hovering over the yellow spot at the left hand side of the image. It is an <img> element (well actually it's an image together with an image ...
4
votes
1answer
557 views
Scrape using Beautiful Soup preserving entities
I would like to scrape a table from the web and keep the entities intact so that I can republish as HTML later. BeautifulSoup seems to be converting these to spaces though. Example:
from ...
4
votes
2answers
1k views
Html Entity Name vs entity Number?
I saw this table :
when I program Asp.net and want to display these special html entities , I use Entity Name.
(but both seems to work)
question :
in what scenarios should I use entity number ...
4
votes
1answer
1k views
Encode HTML entities
I am parsing some data from feedburner of which contains HTML entities. I am trying to encode the HTML entities using jQuery as such:
var encodedStr = data['1']['result']['content']; // content with ...
4
votes
1answer
363 views
get original dom element innerHTML without javascript processing
Background - in an article editor powered by TinyMCE for an enterprise in-house CMS behind large media site/s
HTML
<p>non-breaking-space: pound: £ copyright: ...
3
votes
4answers
2k views
How to convert & characters to HTML characters?
<?php echo "Hello World!"; ?>
should be:
<?php echo "Hello World!"; ?>
How do I do that in PHP?
3
votes
6answers
6k views
why can't php just convert quotes to html entities for mysql?
PHP uses "magic quotes" by default but has gotten a lot of flak for it. I understand it will disable it in next major version of PHP.
While the arguments against it makes sense, what I don't get it ...
3
votes
2answers
2k views
ampersand in email address (href)
Im working with email address which has an ampersand in it,
the user wants a 'contact us' link to open up a new message wit their address populated,
I normally use href, but the ampersand is causing ...
3
votes
4answers
185 views
what is the name of this type of encode?
If you copy and paste the following text in a html page,
انوان
you will the following Arabic text:
انوان
My ...
3
votes
7answers
98 views
How to print a pound “£” in html file?
i am trying to display a pound sign in my html page.i want to display it through a variable because i am getting the values of sign from an xml file.
Here is Code:
var sign = ...