Skip to content

Commit dfedf7c

Browse files
committed
Clarify the reason u8 is used instead of u7
1 parent e43d874 commit dfedf7c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/std/ascii.zig

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
//! The ASCII character encoding standard.
1+
//! The 7-bit [ASCII](https://en.wikipedia.org/wiki/ASCII) character encoding standard.
2+
//!
3+
//! This is not to be confused with the 8-bit [Extended ASCII](https://en.wikipedia.org/wiki/Extended_ASCII).
4+
//!
5+
//! The reason `u8` is used as the type instead of `u7` is convenience.
26
//!
37
//! See also: https://en.wikipedia.org/wiki/ASCII#Character_set
48

5-
// I could have taken only a u7 to make this clear, but it would be slower
6-
// It is my opinion that encodings other than UTF-8 should not be supported.
7-
//
8-
// (and 128 bytes is not much to pay).
9-
// Also does not handle Unicode character classes.
10-
119
const std = @import("std");
1210
const mem = std.mem;
1311
const testing = std.testing;

0 commit comments

Comments
 (0)