Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++CodeRAD Studio

Learn How to Use C++ Unicode String Literals For Windows Development With C++Builder

C++ supports various string and character types, and provides ways to express literal values of each of these types.

A string literal represents a sequence of characters that together form a null-terminated string. The characters must be enclosed between double quotation marks. There are the following kinds of string literals:

  • Narrow string literals
  • UTF-8 encoded strings
  • Wide string literals
  • char16_t and char32_t (C++ 11)
  • Raw string literals (C++ 11)
  • std::string literals (C++14)

C++11 introduces new character types to manipulate Unicode string literals. Such portable types are char16_t (16-bit Unicode) and char32_t (32-bit Unicode) character types. It added the literal prefixes u8, u and U that specify known sizes and encodings, respectively UTF-8, UTF-16 and UTF-32. But no matter whether one chooses u8, u or U, the code needs added runtime conversions on one or the other platform.

On top of this one can directly use Unicode escape sequences to code a certain symbol without having to worry about encoding.

Head over and find out more about all of the latest modern C++ features in the Embarcadero DocWiki.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Related posts
CodeDatabaseDelphiRAD Studio

Quickly Learn How Easy It Is To Bind DataSets To Visual Controls In Delphi With LiveBindings

C++CodeRAD Studio

Learn How To Use C++ Incomplete Return Types In Windows Development

C++Delphi

Create Beautiful Windows Applications With Visually Stunning VCL Styles For Delphi And C++

CodeDelphiRAD Studio

Master A Powerful Way To Execute Multiple SQL Commands In Delphi With This Windows Sample

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES