ASCII

Um padrão de codificação de caracteres de 7 bits que mapeia 128 caracteres para valores numéricos (0-127).

A matemática do ASCII permitia conversões rápidas de maiúsculas para minúsculas invertendo um único bit (o 6º). Embora substituído pelo Unicode, a base da internet moderna ainda depende da tabela ASCII de 128 caracteres original.

        graph LR
  Center["ASCII"]:::main
  Rel_unicode["unicode"]:::related -.-> Center
  click Rel_unicode "/terms/unicode"
  Rel_binary["binary"]:::related -.-> Center
  click Rel_binary "/terms/binary"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 Explique como se eu tivesse 5 anos

Computadores só entendem números. ASCII é como um código secreto universal: 'O número 65 significa A maiúsculo, e 32 significa espaço em branco'.

🤓 Expert Deep Dive

O verdadeiro ASCII tem estritamente 7 bits. Os caracteres de controle iniciais destinavam-se a teletipos (CR, LF, BEL). O uso do 8º bit gerou códigos de 'ASCII estendido' fragmentados (ISO-8859-1). O design do UTF-8 manteve 100% de compatibilidade retroativa com os dados ASCII.

❓ Perguntas frequentes

Why is ASCII only 7 bits instead of 8 bits?

When ASCII was developed in the 1960s, a 7-bit code was sufficient to represent the English alphabet, numbers, and punctuation. The 8th bit in a byte was often reserved as a parity bit to check for errors during data transmission over unreliable networks.

What is the difference between ASCII and Unicode?

ASCII is limited to 128 characters and primarily supports English. Unicode is a massive standard designed to support over 149,000 characters across almost every language in the world, plus emojis. However, the first 128 characters of Unicode are identical to ASCII.

What are Extended ASCII codes?

Since computers use 8-bit bytes, the 7-bit ASCII standard left the 8th bit unused (values 128-255). Different companies (like IBM, Apple, and Microsoft) used these extra 128 slots for foreign letters and drawing symbols, creating incompatible 'Extended ASCII' code pages.

📚 Fontes