Search⌘ K
AI Features

Characters: Types and Literals

Explore the different character types in D, including char, wchar, and dchar, and understand how to use character literals, Unicode encodings, and control characters. Learn how to properly include special characters like single quotes and backslashes in your code.

The character types of D

There are three D types to represent characters. These characters correspond to the three Unicode encodings mentioned previously: UTF-32, UTF-16, and UTF-8. Copying from the fundamental types lesson:

Compared to some other programming languages, characters in D may consist of a different number of bytes. For ...