5 Encoding and decoding

 

It’s easy to confuse the topic of encoding and decoding with encryption. These are similar procedures, but the purpose of encryption is to conceal and safeguard information. Encoding is done for transportation of information that may be too complex for the medium or to translate between different systems or for other innocuous purposes. Regardless, the process of encoding and decoding has the potential to be action packed and full of intrigue.

Well, perhaps not.

Still, back in the early days of computer telecommunications, encoding and decoding were regular occurrences. I remember transferring my first program over a modem: 16 kilobytes that took 16 minutes to transfer. That program consisted of binary data, but it was transported as plain text. It required encoding on the sending end and decoding on the receiving end. Such magic happens today as well, though probably much faster.

To explore the concept of encoding and decoding, regardless of the thrills and dangers, you must:

  • Appreciate how characters are represented on computers
  • Learn various ASCII encoding tricks
  • Play with character representation
  • Translate plain text into hex bytes for data transfer
  • Reverse translate hex bytes back into text (or data)
  • Improve encoding techniques by adding checksums
  • Explore the URL encoding method

5.1 The concept of plain text

5.1.1 Understanding ASCII

5.1.2 Exploring the control codes

5.1.3 Generating noncharacter output

5.1.4 Playing with ASCII conversion tricks

5.2 The hex encoder/decoder

5.2.1 Writing a simple hex encoder/decoder

5.2.2 Coding a better hex encoder/decoder

5.2.3 Adding a wee bit of error-checking

5.3 URL encoding

5.3.1 Knowing all the URL encoding rules