—

ASCII Character: Em dash

ASCII Code 151 · Unicode U+0097 · Hex 0x97

About the Em dash Character

ASCII code 151 (0x97) represents the Em dash character in the extended ASCII table (128–255). It is a typographic character used in professional publishing, quotation formatting, and editorial design. The extended ASCII range builds upon the original 128-character ASCII set, adding accented letters, currency symbols, typographic marks, and mathematical symbols. These characters are defined by the Windows-1252 (CP-1252) encoding, which is a superset of ISO 8859-1 (Latin-1). In modern web development, UTF-8 encoding is preferred, but understanding extended ASCII remains important for legacy system compatibility and character encoding troubleshooting.

Encoding Details

ASCII Code 151
Hexadecimal 0x97
Octal 227
Binary 10010111
Unicode U+0097
Unicode Name EM DASH
HTML Numeric —
HTML Entity
URL Escape %97
UTF-8 (Hex) E2 80 94
Quoted-Printable =97

Source Code Examples

JavaScript
// Character literal
let char = '—';
// Using char code
let char2 = String.fromCharCode(151);
// Unicode escape
let char3 = '\u0097';
Python
# Character literal
char = '—'
# Using chr()
char = chr(151)
# Using ord() to get code
code = ord('—')  # Returns 151
HTML
<!-- Direct character -->
—
<!-- HTML entity (numeric) -->
&#151;
<!-- Hex entity -->
&#x97;
C#
// Character literal
char c = '—';
// Using cast
char c2 = (char)151;
// To get code from char
int code = (int)'—';  // Returns 151

Navigate

Copied!