Clone this repo:
  1. 38b24d7 fix deprecated URL by Kevin Moore · 8 weeks ago master
  2. 35b8872 Delete codereview.settings by Kevin Moore · 2 months ago
  3. 9085e6b Enable standard lints, run travis on oldest supported SDK (#10) by Kevin Moore · 6 months ago
  4. be6cc52 prepare to release 1.1.2 (#9) by Kevin Moore · 1 year, 3 months ago v1.1.2
  5. 62445bb Remove -dev.infinity in SDK upper constraint by Kevin Moore · 2 years, 1 month ago

Character code constants.

Build Status Pub

These libraries define symbolic names for some character codes.


Import either one of the libraries:

import "package:charcode/ascii.dart";
import "package:charcode/html_entity.dart";

or import both libraries using the charcode.dart library:

import "package:charcode/charcode.dart";


The character names are preceded by a $ to avoid conflicting with other variables due to the short and common names (for example “$i”).

The characters that are valid in a Dart identifier directly follow the $. Examples: $_, $a, $B and $3. Other characters are given symbolic names.

The names of letters are lower-case for lower-case letters, and mixed- or upper-case for upper-case letters. The names of symbols are all lower-case, and omit suffixes like “sign”, “symbol” and “mark”. Examples: $plus, $exclamation

The ascii.dart library defines a symbolic name for each ASCII character. For some characters, it has more than one name. For example the common $tab and the official $ht for the horizontal tab.

The html_entity.dart library defines a constant for each HTML 4.01 character entity, using the standard entity abbreviation, including its case. Examples: $nbsp for &nbps;, $aring for the lower-case å and $Aring for the upper-case Å.

The HTML entities includes all characters in the Latin-1 code page, greek letters and some mathematical symbols.

The charcode.dart library just exports both ascii.dart and html_entity.dart.


The Dart language doesn't have character literals. If that ever happens, this library will be irrelevant. Until then, this library can be used for the most common characters. See request for character literals.