Monday, January 20, 2025
HomeProgrammingInvisible Characters - ASCII

Invisible Characters – ASCII

Invisible characters in ASCII are non-printable characters that do not have a visual representation on the screen. These characters are often used for control purposes, formatting, or special signaling in text or data streams.

Types of Invisible ASCII Characters

1. Control Characters (ASCII 0–31 and 127)

These characters are non-printable and are used for controlling devices, text formatting, or signaling.

ASCII Code Character Name Description
0 NUL Null No operation (used as a string terminator).
1 SOH Start of Header Marks the start of a header.
2 STX Start of Text Marks the start of text data.
3 ETX End of Text Marks the end of text data.
4 EOT End of Transmission Marks the end of transmission.
5 ENQ Enquiry Requests a response from a device.
6 ACK Acknowledge Acknowledges receipt of data.
7 BEL Bell Triggers an alert sound or visual alert.
8 BS Backspace Moves the cursor one character back.
9 TAB Horizontal Tab Moves the cursor to the next tab stop.
10 LF Line Feed Moves the cursor to the next line.
11 VT Vertical Tab Moves the cursor vertically.
12 FF Form Feed Advances the printer to a new page.
13 CR Carriage Return Moves the cursor to the beginning of the line.
14 SO Shift Out Switches to an alternate character set.
15 SI Shift In Switches back to the default character set.
16 DLE Data Link Escape Signals control of a communication link.
127 DEL Delete Marks a deleted character (historically).
See also  rand() and srand() in C+

2. Whitespace Characters

Whitespace characters are technically visible in that they create space but do not render glyphs.

ASCII Code Character Name Description
9 TAB Horizontal Tab Creates a tab space.
10 LF Line Feed Moves the cursor to a new line.
11 VT Vertical Tab Moves the cursor vertically.
12 FF Form Feed Starts a new page.
13 CR Carriage Return Returns the cursor to the start of the line.
32 Space Space Inserts a blank space.
See also  How can I Convert/Parse from String to char in java?

How to Represent or Use Invisible Characters

  1. Programming and Escape Sequences:
    • Many programming languages allow these characters to be represented using escape sequences:
      • \n for Line Feed (LF)
      • \t for Horizontal Tab (TAB)
      • \r for Carriage Return (CR)
  2. Keyboard Shortcuts:
    • Some invisible characters like TAB (9) or SPACE (32) can be entered directly using the keyboard.
  3. Hexadecimal Representation:
    • Invisible characters can be represented in hexadecimal notation:
      • 0x00 for NUL
      • 0x09 for TAB
      • 0x20 for Space
  4. Viewing Invisible Characters:
    • Tools like text editors (vim, nano) or cat -A in the terminal can help visualize these characters.
See also  DateTime2 vs DateTime in SQL Server: A Detailed Comparison

Practical Applications

  • Communication Protocols: ASCII control characters like ACK, EOT, and STX are used in data communication.
  • Document Formatting: Whitespace characters like TAB and CR structure text files.
  • Programming and Data Parsing: Invisible characters help separate data fields or terminate strings.
  • Testing and Debugging: Invisible characters are often checked to ensure data integrity.

 

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x