Using facets

Internationalization rules are known as facets. A locale object is a container of facets, and you can test if the locale has a specific facet using the has_facet function; if it does, you can get a const reference to the facet by calling the use_facet function. There are six types of facets summarized by seven categories of class in the following table. A facet class is a subclass of the locale::facet nested class.

Facet type Description
codecvt, ctype Converts between one encoding scheme to another and is used to classify characters and convert them to upper or lowercase
collate Controls the ordering and grouping of characters in a string, including comparing and hashing of strings
messages Retrieves localized messages ...

Get Beginning C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.