-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrings.txt
More file actions
23 lines (19 loc) · 913 Bytes
/
strings.txt
File metadata and controls
23 lines (19 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Strings:
Unicode vs ASCII
- Validate what kind of strings are used as inputs from interviewer
- Usually this is Unicode or ASCII
- _All_ text is encoded text. All files require a character set and an encoding scheme
ASCII:
- ASCII is more primitive.
- Defines 128 characters, with numbers from 0 - 128
- e.g., ASCII number 65 = the capital letter 'A'
- Why 128 characters? (a byte should allow for 256 combinations)
- We only use 7 bits for characters. The last bit is called the parity bit.
- The parity bit is used for error checking
- Some versions of 'extended ASCII' use the last bit for more characters instead
Unicode:
- Unicode is a superset of ASCII
- The first 128 numbers have the same meaning as they do in ASCII
- Unicode supports many more characters, up to just under 2^21
- Since Unicode characters don't always fit into 8-bit bytes, there are multiple encodings
- e.g. UTF-8 and UTF-32