Why is encoding and decoding needed for any programming language/database

encodinglanguage-agnostic

While I am able to understand the meaning of encoding and decoding from wikipedia, I am not able to understand why each programming language needs them? And if the answer is related to being able to read data from external source like a database, then why do many of them employ different encoding schemes?

E.x. Python has a default ASCII encoding
Java relies on the underlying O.S,
DB2 database has IBM-1252

Best Answer

Most people like to work with text.

However, computer storage can only work with bytes.

Encoding is the process of converting text to bytes.

Over the past few decades, many different encoding schemes have been developed for different purposes, such as brevity, compatibility, or internationalization.

Today, everything should simply use UTF8. (sadly, not everything does yet)

Related Topic