Coping with the encoded internet world using System.NetEncodings
The internet is the land of encodings! URIs are encoded, HTML provides specific encodings, emails work because of MIME Encoding, and the REST service works because, in some way, the client and server can talk to each other using some sort of encoding! There are many kinds of encoding for different purposes, but in this recipe we will talk about encodings that are handled by the classes contained in the System.NetEncodings.pas
unit.
Getting ready
The System.NetEncodings
unit contains the following classes:
TNetEncoding
: This class is a factory for the actual encoding classes; moreover, it serves as a base class for all other classesTHTMLEncoding
: This class provides methods to encode and decode data in HTML formatTURLEncoding
: This class provides methods to encode and decode data in URL encodingTBase64Encoding
: This class provides methods to encode and decode data in the base64 format
The base64 format is a binary-to-text encoding...