Turning a source item into code for storage or communication in places where ordinary plain language, spoken or written, is difficult or impossible.

For a non-computing example: turning letters into Morse code or semaphore.

In computing terms, encoding is usually for storage of non-standard characters such as à, æ or ç.