Ascii Reference
ASCII is a 7-bit character encoding that remains important in protocols, control characters, and command-line text workflows. It is useful context for sorting, but modern text is not limited to ASCII.
The 128 code points
ASCII assigns values from 0 through 127. The range includes control codes such as NUL and line feed, printable punctuation and digits, uppercase letters, and lowercase letters. For example, uppercase A is decimal 65 and lowercase a is decimal 97.
| Decimal range | Characters | Example or use |
|---|---|---|
| 0–31 | Control codes | Includes tab (9), line feed (10), and carriage return (13). |
| 32 | Space | The printable space character. |
| 48–57 | Digits | 0 through 9. |
| 65–90 | Uppercase letters | A through Z. |
| 97–122 | Lowercase letters | a through z. |
| 127 | DEL control code | A control value, not a printable character. |
ASCII and UTF-8
UTF-8 preserves the ASCII range: code points 0 through 127 have the same single-byte values in UTF-8. Characters outside that range use multi-byte sequences. A byte-oriented tool and a Unicode-aware string operation may therefore impose different comparison rules for non-ASCII text.
Code-point order is not human collation
Ordering strings by numeric code point is different from sorting them according to language-sensitive collation. Case, accents, punctuation, and numeric-looking substrings may be treated differently depending on the chosen rule.
TinyDevTools Sort Lines calls JavaScript localeCompare(). It is intended as a quick readable sort, not an ASCII byte sort or a reproducible canonicalization operation.
Under ASCII numeric ordering, the uppercase letter Z (90) comes before the lowercase letter a (97), with punctuation values such as [ (91) between them. A locale-aware sort may place those characters differently; do not infer byte order from the displayed result.
When exact ordering matters
For generated files, protocol data, or build artifacts, define the required ordering explicitly and use the same locale and options across environments. Record those rules alongside the workflow and test representative non-ASCII input.
Related: Sort Lines behavior, the line endings reference, and the guide to Unix sort and uniq.
Advertisements