HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

Chapter 41


ch38 Codecs: Coding and


Decoding


Contents


41.1 With Codes, Shorter is Better........... 311
41.2 Patents......................... 311
41.3 MIME Types..................... 312
41.4 Encoding Text (Characters)............ 312
41.5 Encoding Images................... 313

Text, images, sounds, and video: these are the media we most often en-
counter on the Internet. Each of these is a natural part of our life experi-
ence.


But for the Internet, they each have one important challenge: encoding.


Briefly put, computers work in a language calledbinary, where everything
is represented by strings of ones and zeroes.


How do we represent things that are not ones and zeroes? How do we
represent, for instance, the number five?


One method, binary integer, represents it as 101.


Another method, ascii character, represents it as 0110101.


Websites must encode all content in ways that the web browsers can correctly
decode, or you just get random characters across your screen.


310

Free download pdf