Book Image

Delphi Cookbook - Second Edition

By : Daniele Teti
Book Image

Delphi Cookbook - Second Edition

By: Daniele Teti

Overview of this book

Delphi is a cross-platform Integrated Development Environment (IDE) that supports rapid application development for Microsoft Windows, Apple Mac OS X, Google Android, and Apple iOS. It helps you to concentrate on the real business and save yourself the pain of wandering amid GUI widget details, or having to tackle inter-platform incompatibilities. It also has a wide range of drag-and-drop controls, helping you code your business logic into your business model, and it compiles natively for desktop and mobile platforms. This book will teach you how to design and develop applications, deploy them on the cloud platform, and distribute them within an organization via Google Play and other similar platforms. You will begin with the basics of Delphi and get acquainted with JSON format strings, XSLT transformations, unicode encodings and various types of streams. We then move on to more advanced topics such as developing higher-order functions and using enumerators and RTTI. You will get an understanding of how Delphi RTL functions and how to use FireMonkey in a VCL application. We will then cover topics such as multithreading, using the parallel programming library and putting Delphi on a server. We will also take a look at the new feature of WebBroker Apache modules and then ride the mobile revolution with FireMonkey. By the end of the book, you will be able to develop and deploy cross-platform applications using Delphi .
Table of Contents (10 chapters)
9
Index

Cope with the encoded Internet world using System.NetEncodings

Internet is the land of the encodings! URIs are encoded, HTML provide specific encodings, e-mails works because of the mime encoding, and the REST service works because in some way the client and server can talk each other using some sort of encodings! There are many kinds of encoding for different purposes, but in this recipe we will talk about the encodings handled by the classes contained in the System.NetEncodings.pas unit.

Getting ready

The unit System.NetEncodings contains the following classes:

  • TNetEncoding: This class is a factory for the actual encoding classes; moreover, it serves as a base class for all the other classes
  • THTMLEncoding: This class provides methods to encode and decode data in HTML format
  • TURLEncoding: This class provides methods to encode and decode data in URL encoding
  • TBase64Encoding: This class provides methods to encode and decode data in the base64 format

base64 is a binary-to-text encoding schemes...