Questions tagged [html-entities]

HTML entities provide a method of entering characters that cannot be expressed in the document's character encoding or that cannot easily be entered on a keyboard.

HTML entities provide a method of entering characters that cannot be expressed in the document's character encoding or that cannot easily be entered on a keyboard.

HTML Entities Format

Entities take the form of &entityname; like in   (which means a non-breaking space) or & (which means &). Entities are also case sensitive, so there is a difference between á (which means á) and Á (which means Á).

Numeric Character References

Besides HTML entities, numeric character references can also be used to express characters. While entities are limited, using numeric character references you can express any character.

Numeric Character References Format

The format is &#number;. number can be either decimal or hexadecimal (prefixed with x).

For example:

✓

...can be reproduced using: ✓ (decimal), ✓ (hexadecimal), ✓ or ✓.

Links

1350 questions
82
votes
9 answers

Convert HTML entities to Unicode and vice versa

How do you convert HTML entities to Unicode and vice versa in Python?
hekevintran
  • 22,822
  • 32
  • 111
  • 180
76
votes
9 answers

What's the HTML character entity for the # sign?

What's the HTML character entity for the # sign? I've looked around for "pound" (which keeps returning the currency), and "hash" and "number", but what I try doesn't seem to turn into the right character.
chimerical
  • 5,883
  • 8
  • 31
  • 37
73
votes
3 answers

What is the proper HTML entity for the "x" in a dimension?

Is the proper HTML entity for giving dimensions ×? I want to be semantically correct, but that begs the question, is listing a dimension as 2" x 3" even semantic? If the x represents "by", would I use the letter x or ×? In my code I've been…
Nick
  • 2,872
  • 3
  • 34
  • 43
71
votes
4 answers

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
  • 700 Software
    • 85,281
    • 83
    • 234
    • 341
    67
    votes
    6 answers

    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.
    Ram
    • 1,016
    • 4
    • 15
    • 25
    65
    votes
    7 answers

    How to create string with multiple spaces in JavaScript

    By creating a variable var a = 'something' + ' ' + 'something' I get this value: 'something something'. How can I create a string with multiple spaces on it in JavaScript?
    István
    • 5,057
    • 10
    • 38
    • 67
    61
    votes
    5 answers

    Uses for the '"' entity in HTML

    I am revising some XHTML files authored by another party. As part of this effort, I am doing some bulk editing via Linq to XML. I've just noticed that some of the original source XHTML files contain the " HTML entity in text nodes within those…
    DavidRR
    • 18,291
    • 25
    • 109
    • 191
    61
    votes
    12 answers

    How to convert characters to HTML entities using plain JavaScript

    I have the following: var text = "Übergroße Äpfel mit Würmern"; I'm searching for a Javascript function to transform the text so that every special letter is represented by its HTML entity sequence like this: var newText =…
    Chris
    • 15,429
    • 19
    • 72
    • 74
    60
    votes
    1 answer

    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. ENT_HTML5 Handle code as HTML 5. I want to…
    Saic Siquot
    • 6,513
    • 5
    • 34
    • 56
    59
    votes
    3 answers

    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 places. These characters are a good place to start:…
    David J.
    • 31,569
    • 22
    • 122
    • 174
    59
    votes
    7 answers

    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:

    Camión español

    should be translated into this:

    Camión…

    fidoboy
    • 1,059
    • 3
    • 12
    • 9
    51
    votes
    8 answers

    Short way to escape HTML in Bash?

    The box has no Ruby/Python/Perl etc. Only bash, sed, and awk. A way is to replace chars by map, but it becomes tedious. Perhaps some built-in functionality i'm not aware of?
    James Evans
    • 765
    • 1
    • 7
    • 11
    50
    votes
    4 answers

    Encoding a tab in html

    I can encode a space using   in an HTML document. Is there an equivalent for the tab character? I'm trying to preload a