Length is not always length.
transcript
One emoji on the screen. How long is it? It depends on the language. Count carefully. The screen shows one symbol. The languages disagree. Four languages. Four habits.
Python counts code points. One. Java counts UTF sixteen units. Two. JavaScript also says two. C plus plus counts bytes. Four. The same text. Four numbers. The screen shows one symbol.
The word has five letters. The accent takes two bytes. So it has six bytes in all. Reverse the bytes and it breaks. Bytes are not letters. Many accents take two bytes. Many symbols take four.
State the alphabet first. For ASCII all four agree. Else count with care. Work with characters, not bytes. Test an accented word. Tests with accents catch it. A reader sees one symbol. This course uses ASCII text. Every problem states its alphabet. Then every length agrees. Test one accented word.
State the alphabet. Full breakdown in the lecture.