Back
Asciify Logo
Asciify
EMESC

Substitute

SUB (Substitute) is ASCII code point 26 (0x1A), Unicode U+001A. It is a C0 control character that replaced a byte detected as erroneous during transmission — a teleprinter inserted 0x1A where the original character was unrecoverable. Ctrl+Z emits it, and DOS repurposed that keystroke as its end-of-file marker: many Windows programs still treat 0x1A as EOF when reading text-mode streams, which is why binary files opened as text can be silently truncated. Unix ignored this convention entirely, using Ctrl+Z for SIGTSTP (suspend process) instead — a divergence that still causes confusion in cross-platform file handling. UTF-8 encodes it as the single byte 0x1A; Unicode classifies it as Cc (Control) with the alias SUBSTITUTE.

Symbol

Technical Details

Code Example

</>
unsigned char b = 0x1A; // SUB / Ctrl+Z
if (b == 0x1A) break; // stop at in-band EOF sentinel
out[i++] = b; // only for text-mode conventions

Frequently Asked Questions

  • SUB (ASCII 26) was originally used to indicate a substitution — a character that replaces one that couldn't be transmitted or displayed correctly. It's the 'I couldn't read this, so here's a placeholder' marker.

  • On Windows, Ctrl+Z sends SUB (ASCII 26), which acts as an end-of-file marker for text streams — a convention inherited from CP/M. On Unix, Ctrl+Z sends SIGTSTP (suspend the process), which is a completely different mechanism unrelated to the SUB character.

  • CP/M used SUB (0x1A) to mark end-of-file because its file system tracked sizes in 128-byte blocks, not individual bytes. DOS inherited this convention. That's why typing Ctrl+Z terminates console input on Windows — it's a 1970s workaround that stuck around.

  • If you're reading text files on Windows, be aware that some legacy tools insert 0x1A at the end. Opening files in binary mode ('rb' in Python) avoids this. For Unix, SUB has no special meaning and is just another control byte to sanitize.

@workani&@alexluthor
Privacy & legal

Privacy

No accounts, no ads, no tracking cookies, and no cross-site tracking. The only analytics we keep are faceless — anonymous, aggregated counts of pages and searches, never tied to you. We store no IP addresses, set no tracking cookies, and build no profiles. Cloudflare hosts the site and handles requests for delivery and security.

Full privacy policy·Extension privacy·legal@asciify.dev

Attributions & licenses

Twemoji
© Twitter, Inc and other contributors · CC-BY 4.0
Noto Color Emoji
© Google · Apache 2.0
Fluent UI Emoji
© Microsoft · MIT
OpenMoji
© HfG Schwäbisch Gmünd · CC-BY-SA 4.0
Toss Face
© Viva Republica (Toss) · SIL OFL 1.1
JoyPixels
© JoyPixels Inc. · Free Limited Use License
SerenityOS Emoji
© The SerenityOS Developers · BSD-2-Clause
EmojiTwo
© EmojiTwo contributors · CC-BY 4.0
Apple Color Emoji
© Apple, Inc.
Facebook Emoji
© Meta Platforms, Inc.

Apple and Facebook emoji styles are proprietary and shown here solely for reference and comparison — a common-sense application of nominative-use / fair-use principles. asciify is not affiliated with, endorsed by, or sponsored by Apple, Inc., Meta Platforms, Inc., or any other rights holder listed above. If a rights holder requests removal of their emoji style from this site, it will be removed.

All other vendor emoji are reproduced for reference and comparison under their respective open licenses listed above.

Character names and code points from the Unicode® Standard. Unicode® and the Unicode Logo are registered trademarks of Unicode, Inc.

Privacy
© asciify.dev 2025-2026