Glossary

Encoding (UTF-8, ASCII, Base64)

Encoding is a way of representing characters as bytes. ASCII (1963) — 128 characters, 7 bits. UTF-8 (1993) — Unicode encoding: ASCII characters take 1 byte, others take 2–4. The de facto standard for the web.

UTF-8 in PHP

PHP strings are sequences of bytes, not characters. strlen('Привіт') = 12 (bytes), not 6. For correct Unicode handling, use mb_ functions: mb_strlen(), mb_substr(), mb_strtolower().

Base64

Encodes binary data as a string of 64 characters (A-Z, a-z, 0-9, +, /). Increases size by ~33%. Not encryption — just encoding. Uses:

base64_encode('Hello') // "SGVsbG8="
base64_decode('SGVsbG8=') // "Hello"