{"id":13730269,"url":"https://github.com/tahonermann/text_view","last_synced_at":"2025-06-26T05:02:03.710Z","repository":{"id":133857741,"uuid":"41640449","full_name":"tahonermann/text_view","owner":"tahonermann","description":"A C++ concepts and range based character encoding and code point enumeration library","archived":false,"fork":false,"pushed_at":"2017-11-11T05:25:56.000Z","size":856,"stargazers_count":122,"open_issues_count":18,"forks_count":14,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-06-19T06:48:48.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tahonermann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-08-30T19:30:17.000Z","updated_at":"2025-06-13T20:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"f263173f-9ace-4bf9-86bb-70e53bad0b31","html_url":"https://github.com/tahonermann/text_view","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tahonermann/text_view","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tahonermann","download_url":"https://codeload.github.com/tahonermann/text_view/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262003914,"owners_count":23243345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:12.507Z","updated_at":"2025-06-26T05:02:03.624Z","avatar_url":"https://github.com/tahonermann.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"[![Travis Build Status](https://travis-ci.org/tahonermann/text_view.svg?branch=master)](https://travis-ci.org/tahonermann/text_view)\nTravis CI (Linux:gcc)\n\n[![codecov](https://codecov.io/gh/tahonermann/text_view/branch/master/graph/badge.svg)](https://codecov.io/gh/tahonermann/text_view)\n\n[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\n# [Text_view]\nA [C++ Concepts][ISO/IEC 19217:2015]\nbased character encoding and code point enumeration library.\n\nThis project is the reference implementation for proposal [P0244] for the C++\nstandard.\n\nThis port of [Text_view] requires a C++17 conforming compiler that implements\n[ISO/IEC technical specification 19217:2015, **C++ Extensions for concepts**\n][ISO/IEC 19217:2015].  A port of [Text_view] that builds with C++11 conforming\ncompilers is available at [Text_view for range-v3][Text_view-range-v3].\n\nFor discussion of this project, please post and/or subscribe to the\n`text_view@googlegroups.com` group hosted at\nhttps://groups.google.com/d/forum/text_view\n\n- [Overview](#overview)\n- [Current features and limitations](#current-features-and-limitations)\n- [Requirements](#requirements)\n- [Build and installation](#build-and-installation)\n  - [Building and installing gcc](#building-and-installing-gcc)\n  - [Building and installing cmcstl2](#building-and-installing-cmcstl2)\n  - [Building and installing Text_view](#building-and-installing-text_view)\n- [Usage](#usage)\n  - [Header \u0026lt;experimental/text_view\u0026gt; synopsis](#header-experimentaltext_view-synopsis)\n  - [Concepts](#concepts)\n  - [Error Policies](#error-policies)\n  - [Error Status](#error-status)\n  - [Exceptions](#exceptions)\n  - [Type traits](#type-traits)\n  - [Character sets](#character-sets)\n  - [Character set identification](#character-set-identification)\n  - [Character set information](#character-set-information)\n  - [Characters](#characters)\n  - [Encodings](#encodings)\n  - [Text iterators](#text-iterators)\n  - [Text view](#text-view)\n- [Supported Encodings](#supported-encodings)\n- [Terminology](#terminology)\n  - [Code Unit](#code-unit)\n  - [Code Point](#code-point)\n  - [Character Set](#character-set)\n  - [Character](#character)\n  - [Encoding](#encoding)\n- [References](#references)\n\n# Overview\n[C++11][ISO/IEC 14882:2011] added support for new character types ([N2249]) and\n[Unicode] string literals ([N2442]), but neither [C++11][ISO/IEC 14882:2011],\nnor more recent standards have provided means of efficiently and conveniently\nenumerating [code points](#code-point) in [Unicode] or legacy encodings.  While\nit is possible to implement such enumeration using interfaces provided in the\nstandard `\u003ccodecvt\u003e` library, doing to is awkward, requires that text be\nprovided as pointers to contiguous memory, and inefficent due to virtual\nfunction call overhead (__examples and data required to back up these\nassertions__).\n\n[Text_view] provides iterator and range based interfaces for encoding and\ndecoding strings in a variety of [character encodings](#encoding).  The\ninterface is intended to support all modern and legacy\n[character encodings](#encoding), though this library does not yet provide\nimplementations for legacy [encodings](#encoding).\n\nAn example usage follows.  Note that `\\u00F8` (LATIN SMALL LETTER O WITH STROKE)\nis encoded as UTF-8 using two [code units](#code-unit) (`\\xC3\\xB8`), but\niterator based enumeration sees just the single [code point](#code-point).\n\n```C++\nusing CT = utf8_encoding::character_type;\nauto tv = make_text_view\u003cutf8_encoding\u003e(u8\"J\\u00F8erg is my friend\");\nauto it = tv.begin();\nassert(*it++ == CT{0x004A}); // 'J'\nassert(*it++ == CT{0x00F8}); // 'ø'\nassert(*it++ == CT{0x0065}); // 'e'\n```\n\nThe iterators and ranges that [Text_view] provides are compatible with the\nnon-modifying sequence utilities provided by the standard C++ `\u003calgorithm\u003e`\nlibrary.  This enables use of standard algorithms to search encoded text.\n\n```C++\nit = std::find(tv.begin(), tv.end(), CT{0x00F8});\nassert(it != tv.end());\n```\n\nThe iterators provided by [Text_view] also provide access to the underlying\n[code unit](#code-unit) sequence.\n\n```C++\nauto base_it = it.base_range().begin();\nassert(*base_it++ == '\\xC3');\nassert(*base_it++ == '\\xB8');\nassert(base_it == it.base_range().end());\n```\n\n[Text_view] ranges satisfy the requirements for use in\n[C++11][ISO/IEC 14882:2011] range-based for statements with the removed\nsame type restriction for the begin and end expressions provided by [P0184R0]\nas adopted for C++17.\n\n```C++\nfor (const auto \u0026ch : tv) {\n  ...\n}\n```\n\n# Current features and limitations\n[Text_view] provides interfaces for the following:\n- Encoding and decoding of text for the [encodings](#encoding) listed in\n  [supported encodings](#supported-encodings).\n- Encoding text using [C++11][ISO/IEC 14882:2011] compliant output iterators.\n- Decoding text using input, forward, bidirectional, and random access\n  iterators that are compliant with standard iterator requirements as specified\n  in the [ranges proposal][N4560].\n- Constructing view adapters for encoded text stored in arrays, containers,\n  or std::basic_string, or referenced by another range or view.  These view\n  adapters meet the requirements for views in the [ranges proposal][N4560].\n\n[Text_view] does **not** currently provide interfaces for the following:\n- Transcoding of code points from one [character set](#character-set) to\n  another.\n- Iterators for grapheme clusters or other boundary conditions.\n- Collation.\n- Localization.\n- Internationalization.\n- [Unicode] code point properties.\n- [Unicode] normalization.\n\n# Requirements\n[Text_view] requires a C++ compiler that implements [ISO/IEC technical\nspecification 19217:2015, **C++ Extensions for concepts**][ISO/IEC 19217:2015]\nAs of 2016-08-26, this specification is only supported by [gcc] release\n6.2.0 or later.  Additionally, [Text_view] depends on the [cmcstl2]\nimplementation of the [ranges proposal][N4560] for concept definitions.\n\n# Build and installation\nThis section provides instructions for building [Text_view] and suitable\nversions of its dependencies.\n\n## Building and installing [gcc]\n[Text_view] requires [gcc] version 6.2.0 or later.  The following commands\ncan be used to perform a suitable build of the current in-development release\nof [gcc] on Linux if an installation of [gcc] 6.2.0 or later is not available.\nIf you have an installation of [gcc] 6.2.0 or later available, then there is\nno need to build [gcc] yourself.\n\n```sh\n$ svn co svn://gcc.gnu.org/svn/gcc/trunk gcc-trunk-src\n$ curl -O ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.1.tar.bz2\n$ curl -O ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.bz2\n$ curl -O ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.1.tar.gz\n$ cd gcc-trunk-src\n$ svn update -r 234230  # Optional command to select a known good gcc version\n$ bzip2 -d -c ../gmp-5.1.1.tar.bz2 | tar -xvf -\n$ mv gmp-5.1.1 gmp\n$ bzip2 -d -c ../mpfr-3.1.2.tar.bz2 | tar -xvf -\n$ mv mpfr-3.1.2 mpfr\n$ tar -zxvf ../mpc-1.0.1.tar.gz\n$ mv mpc-1.0.1 mpc\n$ cd ..\n$ mkdir gcc-trunk-build\n$ cd gcc-trunk-build\n$ LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch); export LIBRARY_PATH\n$ CPATH=/usr/include/$(gcc -print-multiarch); export CPATH\n$ ../gcc-trunk-src/configure \\\n  CC=gcc \\\n  CXX=g++ \\\n  --prefix $(pwd)/../gcc-trunk-install \\\n  --disable-multilib \\\n  --disable-bootstrap \\\n  --enable-languages=c,c++\n$ make -j 4\n$ make install\n$ cd ..\n```\n\nWhen complete, the new [gcc] build will be present in the `gcc-trunk-install`\ndirectory.\n\n## Building and installing [cmcstl2]\n[Text_view] only depends on headers provided by [cmcstl2] and no build or\ninstallation is required.  [Text_view] is known to build successfully with\n[cmcstl2] git revision `eb5ecdf79e22eb68c86cb62fd0912559593e5597`.  The\nfollowing commands can be used to checkout a known good revision.\n\n```sh\n$ git clone https://github.com/CaseyCarter/cmcstl2.git cmcstl2\n$ cd cmcstl2\n$ git checkout eb5ecdf79e22eb68c86cb62fd0912559593e5597\n```\n\n## Building and installing [Text_view]\n[Text_view] has a [CMake] based build system sufficient to build and run its\ntests, to validate example code, and to perform a minimal installation following\nestablished operating system conventions.  By default, files will be installed\nunder `/usr/local` on UNIX and UNIX-like systems, and under `C:\\Program Files`\non Windows.  The installation location can be changed by invoking `cmake` with\na `-DCMAKE_INSTALL_PREFIX=\u003cpath\u003e` option.  On UNIX and UNIX-like systems, header\nfiles will be installed in the `include` directory of the installation\ndestination, and other files will be installed under `share/text_view`.  On\nWindows, header files be installed in the `text_view\\include` directory of the\ninstallation destination, and other files will be installed under `text_view`.\n\nUnless [cmcstl2] is installed to a common location, it will be necessary to\ninform the build where it is installed.  This is typically done by setting the\n`CMCSTL2_INSTALL_PATH` environment variable.  As of this writing, [cmcstl2]\ndoes not provide an installation option, so `CMCSTL2_INSTALL_PATH` should\nspecify the location where the [cmcstl2] source resides (the directory that\ncontains the [cmcstl2] `include` directory).\n\nThe following commands suffice to build and run tests and examples, and perform\nan installation.  If the build succeeds, built test and example programs will\nbe present in the `test` and `examples` subdirectories of the build directory\n(the built test and example programs are not installed), and header files,\nexample code, cmake package configuration modules, and other miscellaneous files\nwill be present in the installation directory.\n\n```sh\n$ vi setenv.sh  # Update GCC_INSTALL_PATH and CMCSTL2_INSTALL_PATH.\n$ . ./setenv.sh\n$ mkdir build\n$ cd build\n$ cmake .. [-DCMAKE_INSTALL_PREFIX=/path/to/install/to]\n$ cmake --build . --target install\n$ ctest\n```\n\n`check` and `check-install` [CMake] targets are also available for automating\nbuild and test.  The `check` target performs a build without installation and\nthen runs the tests.  The `check-install` target performs a build, runs tests,\ninstalls to a location within the build directory, and then performs tests\n(verifying that example code builds) on the installation.\n\nThe installation includes a [CMake] based build system for building the example\ncode.  To build all of the examples, run `cmake` specifying the `examples`\ndirectory of the installation as the source directory.  Alternatively, each\nexample can be built independently by specifying its source directory as the\nsource directory in a `cmake` invocation.  If the installation was to a\nnon-default installation location (`-DCMAKE_INSTALL_PREFIX` was specified),\nthen it may be necessary to set `CMAKE_PREFIX_PATH` to the [Text_view]\ninstallation location (the location `CMAKE_INSTALL_PREFIX` was set to) or\n`text_view_DIR` to the directory containing the installed\n`text_view-config.cmake` file, so that the [Text_view] package configuration\nfile is found.  See the [CMake] documentation for more details.\n\nThe following commands suffice to build all of the installed examples.\n\n```sh\n$ cd /path/to/installation/text_view/examples\n$ mkdir build\n$ cd build\n$ cmake .. [-DCMAKE_PREFIX_PATH=/path/to/installation]\n$ cmake --build .\n$ ctest\n```\n\n# Usage\nTo use [Text_view] in your own code, perform a build and installation as\ndescribed above, add include paths for the `text_view/include` and [cmcstl2]\ninstallation locations, add a library search path for the `text_view/lib`\ndirectory, include the `text_view` header file in your sources, and link the\n[text_view] library with your executable.\n\n```C++\n#include \u003cexperimental/text_view\u003e\n```\n\n[Text_view] installations include a [CMake] package configuration file suitable\nfor use in [CMake] based projects.  To use it, specify `text_view` as the\n`\u003cpackage\u003e` argument to `find_package` in your [CMake] file and add invocations\nof `target_link_libraries` for each relevant target with the `\u003clib\u003e` argument\nset to `text-view`.  This will automatically apply compiler and linker options\nrequired to use [Text_view] to each target.  See the `CMakeLists.txt` files for\nthe utilities under the `examples` directory for reference.  If [Text_view] was\ninstalled to a non-default installation location (`-DCMAKE_INSTALL_PREFIX` was\nspecified), then it may be necessary to set `CMAKE_PREFIX_PATH` to the\n[Text_view] installation location (the location `CMAKE_INSTALL_PREFIX` was set\nto) or `text_view_DIR` to the directory containing the installed\n`text_view-config.cmake` file, so that the [Text_view] package configuration\nfile is found.  It is also possible to use the build directory as a\n(non-relocatable) installation directory by setting The `CMAKE_PREFIX_PATH`\nor `text_view_DIR` variables appropriately.  See the [CMake] documentation for\nmore details.  The `CMakeLists.txt` files provided with the installed examples\nexemplify a minimal [CMake] based build system for a downstream consumer of\n[Text_view].\n\nAll interfaces intended for public use are declared in the\n`std::experimental::text` namespace.  The `text` namespace is an inline\nnamespace, so all entities are available from the `std::experimental` namespace\nitself.\n\nThe interface descriptions in the sections that follow use the concept names\nfrom the [ranges proposal][N4560], are intended to be used as specification,\nand should be considered authoritative.  Any differences in behavior as\ndefined by these definitions as compared to the [Text_view] implementation are\nunintentional and should be considered indicatative of a defect in either the\nspecification or the implementation.\n\n## Header \u0026lt;experimental/text_view\u0026gt; synopsis\n\n```C++\nnamespace std {\nnamespace experimental {\ninline namespace text {\n\n// concepts:\ntemplate\u003ctypename T\u003e concept bool CodeUnit();\ntemplate\u003ctypename T\u003e concept bool CodePoint();\ntemplate\u003ctypename T\u003e concept bool CharacterSet();\ntemplate\u003ctypename T\u003e concept bool Character();\ntemplate\u003ctypename T\u003e concept bool CodeUnitIterator();\ntemplate\u003ctypename T, typename V\u003e concept bool CodeUnitOutputIterator();\ntemplate\u003ctypename T\u003e concept bool TextEncodingState();\ntemplate\u003ctypename T\u003e concept bool TextEncodingStateTransition();\ntemplate\u003ctypename T\u003e concept bool TextErrorPolicy();\ntemplate\u003ctypename T\u003e concept bool TextEncoding();\ntemplate\u003ctypename T, typename I\u003e concept bool TextEncoder();\ntemplate\u003ctypename T, typename I\u003e concept bool TextForwardDecoder();\ntemplate\u003ctypename T, typename I\u003e concept bool TextBidirectionalDecoder();\ntemplate\u003ctypename T, typename I\u003e concept bool TextRandomAccessDecoder();\ntemplate\u003ctypename T\u003e concept bool TextIterator();\ntemplate\u003ctypename T, typename I\u003e concept bool TextSentinel();\ntemplate\u003ctypename T\u003e concept bool TextOutputIterator();\ntemplate\u003ctypename T\u003e concept bool TextInputIterator();\ntemplate\u003ctypename T\u003e concept bool TextForwardIterator();\ntemplate\u003ctypename T\u003e concept bool TextBidirectionalIterator();\ntemplate\u003ctypename T\u003e concept bool TextRandomAccessIterator();\ntemplate\u003ctypename T\u003e concept bool TextView();\ntemplate\u003ctypename T\u003e concept bool TextInputView();\ntemplate\u003ctypename T\u003e concept bool TextForwardView();\ntemplate\u003ctypename T\u003e concept bool TextBidirectionalView();\ntemplate\u003ctypename T\u003e concept bool TextRandomAccessView();\n\n// error policies:\nclass text_error_policy;\nclass text_strict_error_policy;\nclass text_permissive_error_policy;\nusing text_default_error_policy = text_strict_error_policy;\n\n// error handling:\nenum class encode_status : int {\n  no_error = /* implementation-defined */,\n  invalid_character = /* implementation-defined */,\n  invalid_state_transition = /* implementation-defined */\n};\nenum class decode_status : int {\n  no_error = /* implementation-defined */,\n  no_character = /* implementation-defined */,\n  invalid_code_unit_sequence = /* implementation-defined */,\n  underflow = /* implementation-defined */\n};\nconstexpr inline bool status_ok(encode_status es) noexcept;\nconstexpr inline bool status_ok(decode_status ds) noexcept;\nconstexpr inline bool error_occurred(encode_status es) noexcept;\nconstexpr inline bool error_occurred(decode_status ds) noexcept;\nconst char* status_message(encode_status es) noexcept;\nconst char* status_message(decode_status ds) noexcept;\n\n// exception classes:\nclass text_error;\nclass text_encode_error;\nclass text_decode_error;\n\n// character sets:\nclass any_character_set;\nclass basic_execution_character_set;\nclass basic_execution_wide_character_set;\nclass unicode_character_set;\n\n// implementation defined character set type aliases:\nusing execution_character_set = /* implementation-defined */ ;\nusing execution_wide_character_set = /* implementation-defined */ ;\nusing universal_character_set = /* implementation-defined */ ;\n\n// character set identification:\nclass character_set_id;\n\ntemplate\u003cCharacterSet CST\u003e\n  inline character_set_id get_character_set_id();\n\n// character set information:\nclass character_set_info;\n\ntemplate\u003cCharacterSet CST\u003e\n  inline const character_set_info\u0026 get_character_set_info();\nconst character_set_info\u0026 get_character_set_info(character_set_id id);\n\n// character set and encoding traits:\ntemplate\u003ctypename T\u003e\n  using code_unit_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using code_point_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using character_set_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using character_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using encoding_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using default_encoding_type_t = /* implementation-defined */ ;\n\n// characters:\ntemplate\u003cCharacterSet CST\u003e class character;\ntemplate \u003c\u003e class character\u003cany_character_set\u003e;\n\ntemplate\u003cCharacterSet CST\u003e\n  bool operator==(const character\u003cany_character_set\u003e \u0026lhs,\n                  const character\u003cCST\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator==(const character\u003cCST\u003e \u0026lhs,\n                  const character\u003cany_character_set\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator!=(const character\u003cany_character_set\u003e \u0026lhs,\n                  const character\u003cCST\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator!=(const character\u003cCST\u003e \u0026lhs,\n                  const character\u003cany_character_set\u003e \u0026rhs);\n\n// encoding state and transition types:\nclass trivial_encoding_state;\nclass trivial_encoding_state_transition;\nclass utf8bom_encoding_state;\nclass utf8bom_encoding_state_transition;\nclass utf16bom_encoding_state;\nclass utf16bom_encoding_state_transition;\nclass utf32bom_encoding_state;\nclass utf32bom_encoding_state_transition;\n\n// encodings:\nclass basic_execution_character_encoding;\nclass basic_execution_wide_character_encoding;\n#if defined(__STDC_ISO_10646__)\nclass iso_10646_wide_character_encoding;\n#endif // __STDC_ISO_10646__\nclass utf8_encoding;\nclass utf8bom_encoding;\nclass utf16_encoding;\nclass utf16be_encoding;\nclass utf16le_encoding;\nclass utf16bom_encoding;\nclass utf32_encoding;\nclass utf32be_encoding;\nclass utf32le_encoding;\nclass utf32bom_encoding;\n\n// implementation defined encoding type aliases:\nusing execution_character_encoding = /* implementation-defined */ ;\nusing execution_wide_character_encoding = /* implementation-defined */ ;\nusing char8_character_encoding = /* implementation-defined */ ;\nusing char16_character_encoding = /* implementation-defined */ ;\nusing char32_character_encoding = /* implementation-defined */ ;\n\n// itext_iterator:\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  requires TextForwardDecoder\u003cET, /* implementation-defined */ \u003e()\n  class itext_iterator;\n\n// itext_sentinel:\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  class itext_sentinel;\n\n// otext_iterator:\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e CUIT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  class otext_iterator;\n\n// otext_iterator factory functions:\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(typename ET::state_type state, IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(typename ET::state_type state, IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\n\n// basic_text_view:\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  class basic_text_view;\n\n// basic_text_view type aliases:\nusing text_view = basic_text_view\u003cexecution_character_encoding,\n                                  /* implementation-defined */ \u003e;\nusing wtext_view = basic_text_view\u003cexecution_wide_character_encoding,\n                                   /* implementation-defined */ \u003e;\nusing u8text_view = basic_text_view\u003cchar8_character_encoding,\n                                    /* implementation-defined */ \u003e;\nusing u16text_view = basic_text_view\u003cchar16_character_encoding,\n                                     /* implementation-defined */ \u003e;\nusing u32text_view = basic_text_view\u003cchar32_character_encoding,\n                                     /* implementation-defined */ \u003e;\n\n// basic_text_view factory functions:\ntemplate\u003cTextEncoding ET, ranges::InputIterator IT, ranges::Sentinel\u003cIT\u003e ST\u003e\n  auto make_text_view(typename ET::state_type state, IT first, ST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::InputIterator IT, ranges::Sentinel\u003cIT\u003e ST\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e::state_type state,\n                      IT first,\n                      ST last)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::InputIterator IT, ranges::Sentinel\u003cIT\u003e ST\u003e\n  auto make_text_view(IT first, ST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::InputIterator IT, ranges::Sentinel\u003cIT\u003e ST\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(IT first, ST last)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::ForwardIterator IT\u003e\n  auto make_text_view(typename ET::state_type state,\n                      IT first,\n                      typename std::make_unsigned\u003cranges::difference_type_t\u003cIT\u003e\u003e::type n)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::ForwardIterator IT\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(typename typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e::state_type state,\n                      IT first,\n                      typename std::make_unsigned\u003cranges::difference_type_t\u003cIT\u003e\u003e::type n)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::ForwardIterator IT\u003e\n  auto make_text_view(IT first,\n                      typename std::make_unsigned\u003cranges::difference_type_t\u003cIT\u003e\u003e::type n)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::ForwardIterator IT\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(IT first,\n                      typename std::make_unsigned\u003cranges::difference_type_t\u003cIT\u003e\u003e::type n)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::InputRange Iterable\u003e\n  auto make_text_view(typename ET::state_type state,\n                      const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::InputRange Iterable\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e::state_type state,\n                      const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::InputRange Iterable\u003e\n  auto make_text_view(const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::InputRange Iterable\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e;\n  }\n  auto make_text_view(const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextInputIterator TIT, TextSentinel\u003cTIT\u003e TST\u003e\n  auto make_text_view(TIT first, TST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cTextView TVT\u003e\n  TVT make_text_view(TVT tv);\n\n} // inline namespace text\n} // namespace experimental\n} // namespace std\n```\n\n## Concepts\n\n- [Concept CodeUnit](#concept-codeunit)\n- [Concept CodePoint](#concept-codepoint)\n- [Concept CharacterSet](#concept-characterset)\n- [Concept Character](#concept-character)\n- [Concept CodeUnitIterator](#concept-codeunititerator)\n- [Concept CodeUnitOutputIterator](#concept-codeunitoutputiterator)\n- [Concept TextEncodingState](#concept-textencodingstate)\n- [Concept TextEncodingStateTransition](#concept-textencodingstatetransition)\n- [Concept TextErrorPolicy](#concept-texterrorpolicy)\n- [Concept TextEncoding](#concept-textencoding)\n- [Concept TextEncoder](#concept-textencoder)\n- [Concept TextForwardDecoder](#concept-textforwarddecoder)\n- [Concept TextBidirectionalDecoder](#concept-textbidirectionaldecoder)\n- [Concept TextRandomAccessDecoder](#concept-textrandomaccessdecoder)\n- [Concept TextIterator](#concept-textiterator)\n- [Concept TextSentinel](#concept-textsentinel)\n- [Concept TextOutputIterator](#concept-textoutputiterator)\n- [Concept TextInputIterator](#concept-textinputiterator)\n- [Concept TextForwardIterator](#concept-textforwarditerator)\n- [Concept TextBidirectionalIterator](#concept-textbidirectionaliterator)\n- [Concept TextRandomAccessIterator](#concept-textrandomaccessiterator)\n- [Concept TextView](#concept-textview)\n- [Concept TextInputView](#concept-textinputview)\n- [Concept TextForwardView](#concept-textforwardview)\n- [Concept TextBidirectionalView](#concept-textbidirectionalview)\n- [Concept TextRandomAccessView](#concept-textrandomaccessview)\n\n### Concept CodeUnit\nThe `CodeUnit` concept specifies requirements for a type usable as the\n[code unit](#code-unit) type of a string type.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool CodeUnit() {\n  return /* implementation-defined */ ;\n}\n```\n\n`CodeUnit\u003cT\u003e()` is satisfied if and only if\n`std::is_integral\u003cT\u003e::value` is true and at least one of\n`std::is_unsigned\u003cT\u003e::value` is true,\n`std::is_same\u003cstd::remove_cv_t\u003cT\u003e, char\u003e::value` is true, or\n`std::is_same\u003cstd::remove_cv_t\u003cT\u003e, wchar_t\u003e::value` is true.\n\n### Concept CodePoint\nThe `CodePoint` concept specifies requirements for a type usable as the\n[code point](#code-point) type of a [character set](#character-set) type.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool CodePoint() {\n  return /* implementation-defined */ ;\n}\n```\n\n`CodePoint\u003cT\u003e()` is satisfied if and only if\n`std::is_integral\u003cT\u003e::value` is true and at least one of\n`std::is_unsigned\u003cT\u003e::value` is true,\n`std::is_same\u003cstd::remove_cv_t\u003cT\u003e, char\u003e::value` is true, or\n`std::is_same\u003cstd::remove_cv_t\u003cT\u003e, wchar_t\u003e::value` is true.\n\n### Concept CharacterSet\nThe `CharacterSet` concept specifies requirements for a type that describes\na [character set](#character-set).  Such a type has a member typedef-name\ndeclaration for a type that satisfies `CodePoint`, a static member function\nthat returns a name for the [character set](#character-set), and a static\nmember function that returns a code point value to be used to construct a\nsubstitution character to stand in when errors occur during encoding and\ndecoding operations when the permissive error policy is in effect.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool CharacterSet() {\n  return CodePoint\u003ccode_point_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires () {\n           { T::get_name() } noexcept -\u003e const char *;\n           { T::get_substitution_code_point() } noexcept -\u003e code_point_type_t\u003cT\u003e;\n         };\n}\n```\n\n### Concept Character\nThe `Character` concept specifies requirements for a type that describes a\n[character](#character) as defined by an associated\n[character set](#character-set).  Non-static member functions provide access to\nthe [code point](#code-point) value of the described [character](#character).\nTypes that satisfy `Character` are regular and copyable.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool Character() {\n  return ranges::Regular\u003cT\u003e()\n      \u0026\u0026 ranges::Constructible\u003cT, code_point_type_t\u003ccharacter_set_type_t\u003cT\u003e\u003e\u003e()\n      \u0026\u0026 CharacterSet\u003ccharacter_set_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires (T t,\n                   const T ct,\n                   code_point_type_t\u003ccharacter_set_type_t\u003cT\u003e\u003e cp)\n         {\n           { t.set_code_point(cp) } noexcept;\n           { ct.get_code_point() } noexcept\n               -\u003e code_point_type_t\u003ccharacter_set_type_t\u003cT\u003e\u003e;\n           { ct.get_character_set_id() }\n               -\u003e character_set_id;\n         };\n}\n```\n\n### Concept CodeUnitIterator\nThe `CodeUnitIterator` concept specifies requirements of an iterator that\nhas a value type that satisfies `CodeUnit`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool CodeUnitIterator() {\n  return ranges::Iterator\u003cT\u003e()\n      \u0026\u0026 CodeUnit\u003cranges::value_type_t\u003cT\u003e\u003e();\n}\n```\n\n### Concept CodeUnitOutputIterator\nThe `CodeUnitOutputIterator` concept specifies requirements of an output\niterator that can be assigned from a type that satisfies `CodeUnit`.\n\n```C++\ntemplate\u003ctypename T, typename V\u003e concept bool CodeUnitOutputIterator() {\n  return ranges::OutputIterator\u003cT, V\u003e()\n      \u0026\u0026 CodeUnit\u003cV\u003e();\n}\n```\n\n### Concept TextEncodingState\nThe `TextEncodingState` concept specifies requirements of types that hold\n[encoding](#encoding) state.  Such types are semiregular.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextEncodingState() {\n  return ranges::Semiregular\u003cT\u003e();\n}\n```\n\n### Concept TextEncodingStateTransition\nThe `TextEncodingStateTransition` concept specifies requirements of types\nthat hold [encoding](#encoding) state transitions.  Such types are\nsemiregular.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextEncodingStateTransition() {\n  return ranges::Semiregular\u003cT\u003e();\n}\n```\n\n### Concept TextErrorPolicy\nThe `TextErrorPolicy` concept specifies requirements of types used\nto specify error handling policies.  Such types are semiregular class types\nthat derive from class `text_error_policy`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextErrorPolicy() {\n  return ranges::Semiregular\u003cT\u003e()\n      \u0026\u0026 ranges::DerivedFrom\u003cT, text_error_policy\u003e()\n      \u0026\u0026 !ranges::Same\u003cstd::remove_cv_t\u003cT\u003e, text_error_policy\u003e();\n}\n```\n\n### Concept TextEncoding\nThe `TextEncoding` concept specifies requirements of types that define an\n[encoding](#encoding).  Such types define member types that identify the\n[code unit](#code-unit), [character](#character), encoding state, and encoding\nstate transition types, a static member function that returns an initial\nencoding state object that defines the encoding state at the beginning of a\nsequence of encoded characters, and static data members that specify the\nminimum and maximum number of [code units](#code-units) used to encode any\nsingle character.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextEncoding() {\n  return requires () {\n           { T::min_code_units } noexcept -\u003e int;\n           { T::max_code_units } noexcept -\u003e int;\n         }\n      \u0026\u0026 TextEncodingState\u003ctypename T::state_type\u003e()\n      \u0026\u0026 TextEncodingStateTransition\u003ctypename T::state_transition_type\u003e()\n      \u0026\u0026 CodeUnit\u003ccode_unit_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 Character\u003ccharacter_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires () {\n           { T::initial_state() } noexcept\n               -\u003e const typename T::state_type\u0026;\n         };\n}\n```\n\n### Concept TextEncoder\nThe `TextEncoder` concept specifies requirements of types that are used to\nencode [characters](#character) using a particular [code unit](#code-unit)\niterator that satisfies `OutputIterator`.  Such a type satisifies\n`TextEncoding` and defines static member functions used to encode state\ntransitions and [characters](#character).\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextEncoder() {\n  return TextEncoding\u003cT\u003e()\n      \u0026\u0026 ranges::OutputIterator\u003cCUIT, code_unit_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires (\n           typename T::state_type \u0026state,\n           CUIT \u0026out,\n           typename T::state_transition_type stt,\n           int \u0026encoded_code_units)\n         {\n           { T::encode_state_transition(state, out, stt, encoded_code_units) }\n             -\u003e encode_status;\n         }\n      \u0026\u0026 requires (\n           typename T::state_type \u0026state,\n           CUIT \u0026out,\n           character_type_t\u003cT\u003e c,\n           int \u0026encoded_code_units)\n         {\n           { T::encode(state, out, c, encoded_code_units) }\n             -\u003e encode_status;\n         };\n}\n```\n\n### Concept TextForwardDecoder\nThe `TextForwardDecoder` concept specifies requirements of types that are used\nto decode [characters](#character) using a particular [code unit](#code-unit)\niterator that satisifies `ForwardIterator`.  Such a type satisfies\n`TextEncoding` and defines a static member function used to decode state\ntransitions and [characters](#character).\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextForwardDecoder() {\n  return TextEncoding\u003cT\u003e()\n      \u0026\u0026 ranges::ForwardIterator\u003cCUIT\u003e()\n      \u0026\u0026 ranges::ConvertibleTo\u003cranges::value_type_t\u003cCUIT\u003e,\n                               code_unit_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires (\n           typename T::state_type \u0026state,\n           CUIT \u0026in_next,\n           CUIT in_end,\n           character_type_t\u003cT\u003e \u0026c,\n           int \u0026decoded_code_units)\n         {\n           { T::decode(state, in_next, in_end, c, decoded_code_units) }\n             -\u003e decode_status;\n         };\n\n}\n```\n\n### Concept TextBidirectionalDecoder\nThe `TextBidirectionalDecoder` concept specifies requirements of types that\nare used to decode [characters](#character) using a particular\n[code unit](#code-unit) iterator that satisifies `BidirectionalIterator`.  Such\na type satisfies `TextForwardDecoder` and defines a static member function\nused to decode state transitions and [characters](#character) in the reverse\norder of their encoding.\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextBidirectionalDecoder() {\n  return TextForwardDecoder\u003cT, CUIT\u003e()\n      \u0026\u0026 ranges::BidirectionalIterator\u003cCUIT\u003e()\n      \u0026\u0026 requires (\n           typename T::state_type \u0026state,\n           CUIT \u0026in_next,\n           CUIT in_end,\n           character_type_t\u003cT\u003e \u0026c,\n           int \u0026decoded_code_units)\n         {\n           { T::rdecode(state, in_next, in_end, c, decoded_code_units) }\n             -\u003e decode_status;\n         };\n}\n```\n\n### Concept TextRandomAccessDecoder\nThe `TextRandomAccessDecoder` concept specifies requirements of types that\nare used to decode [characters](#character) using a particular\n[code unit](#code-unit) iterator that satisifies `RandomAccessIterator`.  Such a\ntype satisfies `TextBidirectionalDecoder`, requires that the minimum and\nmaximum number of [code units](#code-unit) used to encode any character have\nthe same value, and that the encoding state be an empty type.\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextRandomAccessDecoder() {\n  return TextBidirectionalDecoder\u003cT, CUIT\u003e()\n      \u0026\u0026 ranges::RandomAccessIterator\u003cCUIT\u003e()\n      \u0026\u0026 T::min_code_units == T::max_code_units\n      \u0026\u0026 std::is_empty\u003ctypename T::state_type\u003e::value;\n}\n```\n\n### Concept TextIterator\nThe `TextIterator` concept specifies requirements of iterator types that are\nused to encode and decode [characters](#character) as an [encoded](#encoding)\nsequence of [code units](#code-unit).  [Encoding](#encoding) state and error\nindication is held in each iterator instance and is made accessible via\nnon-static member functions.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextIterator() {\n  return ranges::Iterator\u003cT\u003e()\n      \u0026\u0026 TextEncoding\u003cencoding_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 TextErrorPolicy\u003ctypename T::error_policy\u003e()\n      \u0026\u0026 TextEncodingState\u003ctypename T::state_type\u003e()\n      \u0026\u0026 requires (const T ct) {\n           { ct.state() } noexcept\n               -\u003e const typename encoding_type_t\u003cT\u003e::state_type\u0026;\n           { ct.error_occurred() } noexcept\n               -\u003e bool;\n         };\n}\n```\n\n### Concept TextSentinel\nThe `TextSentinel` concept specifies requirements of types that are used to\nmark the end of a range of encoded [characters](#character).  A type T that\nsatisfies `TextIterator` also satisfies `TextSentinel\u003cT\u003e` there by enabling\n`TextIterator` types to be used as sentinels.\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextSentinel() {\n  return ranges::Sentinel\u003cT, I\u003e()\n      \u0026\u0026 TextIterator\u003cI\u003e()\n      \u0026\u0026 TextErrorPolicy\u003ctypename T::error_policy\u003e();\n}\n```\n\n### Concept TextOutputIterator\nThe `TextOutputIterator` concept refines `TextIterator` with a requirement that\nthe type also satisfy `ranges::OutputIterator` for the character type of the\nassociated encoding and that a member function be provided for retrieving error\ninformation.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextOutputIterator() {\n  return TextIterator\u003cI\u003e();\n      \u0026\u0026 ranges::OutputIterator\u003cT, character_type_t\u003cencoding_type_t\u003cT\u003e\u003e\u003e()\n      \u0026\u0026 requires (const T ct) {\n           { ct.get_error() } noexcept\n               -\u003e encode_status;\n         };\n}\n```\n\n### Concept TextInputIterator\nThe `TextInputIterator` concept refines `TextIterator` with requirements that\nthe type also satisfy `ranges::InputIterator`, that the iterator value type\nsatisfy `Character`, and that a member function be provided for retrieving error\ninformation.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextInputIterator() {\n  return TextIterator\u003cT\u003e()\n      \u0026\u0026 ranges::InputIterator\u003cT\u003e()\n      \u0026\u0026 Character\u003cranges::value_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires (const T ct) {\n           { ct.get_error() } noexcept\n               -\u003e decode_status;\n         };\n}\n```\n\n### Concept TextForwardIterator\nThe `TextForwardIterator` concept refines `TextInputIterator` with a requirement\nthat the type also satisfy `ranges::ForwardIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextForwardIterator() {\n  return TextInputIterator\u003cT\u003e()\n      \u0026\u0026 ranges::ForwardIterator\u003cT\u003e();\n}\n```\n\n### Concept TextBidirectionalIterator\nThe `TextBidirectionalIterator` concept refines `TextForwardIterator` with a\nrequirement that the type also satisfy `ranges::BidirectionalIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextBidirectionalIterator() {\n  return TextForwardIterator\u003cT\u003e()\n      \u0026\u0026 ranges::BidirectionalIterator\u003cT\u003e();\n}\n```\n\n### Concept TextRandomAccessIterator\nThe `TextRandomAccessIterator` concept refines `TextBidirectionalIterator` with\na requirement that the type also satisfy `ranges::RandomAccessIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextRandomAccessIterator() {\n  return TextBidirectionalIterator\u003cT\u003e()\n      \u0026\u0026 ranges::RandomAccessIterator\u003cT\u003e();\n}\n```\n\n### Concept TextView\nThe `TextView` concept specifies requirements of types that provide view access\nto an underlying [code unit](#code-unit) range.  Such types satisfy\n`ranges::View`, provide iterators that satisfy `TextIterator`, define member\ntypes that identify the [encoding](#encoding), encoding state, and underlying\n[code unit](#code-unit) range and iterator types.  Non-static member functions\nare provided to access the underlying [code unit](#code-unit) range and initial\n[encoding](#encoding) state.\n\nTypes that satisfy `TextView` do not own the underlying [code unit](#code-unit)\nrange and are copyable in constant time.  The lifetime of the underlying range\nmust exceed the lifetime of referencing `TextView` objects.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextView() {\n  return ranges::View\u003cT\u003e()\n      R\u0026 TextIterator\u003cranges::iterator_t\u003cT\u003e\u003e()\n      \u0026\u0026 TextEncoding\u003cencoding_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 ranges::View\u003ctypename T::view_type\u003e()\n      \u0026\u0026 TextErrorPolicy\u003ctypename T::error_policy\u003e()\n      \u0026\u0026 TextEncodingState\u003ctypename T::state_type\u003e()\n      \u0026\u0026 CodeUnitIterator\u003ccode_unit_iterator_t\u003cT\u003e\u003e()\n      R\u0026 requires (T t, const T ct) {\n           { ct.base() } noexcept\n               -\u003e const typename T::view_type\u0026;\n           { ct.initial_state() } noexcept\n               -\u003e const typename T::state_type\u0026;\n         };\n}\n```\n\n### Concept TextInputView\nThe `TextInputView` concept refines `TextView` with a requirement that the\nview's iterator type also satisfy `TextInputIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextInputView() {\n  return TextView\u003cT\u003e()\n      \u0026\u0026 TextInputIterator\u003cranges::iterator_t\u003cT\u003e\u003e();\n}\n```\n\n### Concept TextForwardView\nThe `TextForwardView` concept refines `TextInputView` with a requirement that\nthe view's iterator type also satisfy `TextForwardIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextForwardView() {\n  return TextInputView\u003cT\u003e()\n      \u0026\u0026 TextForwardIterator\u003cranges::iterator_t\u003cT\u003e\u003e();\n}\n```\n\n### Concept TextBidirectionalView\nThe `TextBidirectionalView` concept refines `TextForwardView` with a requirement\nthat the view's iterator type also satisfy `TextBidirectionalIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextBidirectionalView() {\n  return TextForwardView\u003cT\u003e()\n      \u0026\u0026 TextBidirectionalIterator\u003cranges::iterator_t\u003cT\u003e\u003e();\n}\n```\n\n### Concept TextRandomAccessView\nThe `TextRandomAccessView` concept refines `TextBidirectionalView` with a\nrequirement that the view's iterator type also satisfy\n`TextRandomAccessIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextRandomAccessView() {\n  return TextBidirectionalView\u003cT\u003e()\n      \u0026\u0026 TextRandomAccessIterator\u003cranges::iterator_t\u003cT\u003e\u003e();\n}\n```\n\n## Error Policies\n\n- [Class text_error_policy](#class-text_error_policy)\n- [Class text_strict_error_policy](#class-text_strict_error_policy)\n- [Class text_permissive_error_policy](#class-text_permissive_error_policy)\n- [Alias text_default_error_policy](#alias-text_default_error_policy)\n\n### Class text_error_policy\n\nClass `text_error_policy` is a base class from which all text error policy\nclasses must derive.\n\n```C++\nclass text_error_policy {};\n```\n\n### Class text_strict_error_policy\n\nThe `text_strict_error_policy` class is a policy class that specifies that\nexceptions be thrown for errors that occur during encoding and decoding\noperations initiated through text iterators.  This class satisfies\n`TextErrorPolicy`.\n\n```C++\nclass text_strict_error_policy : public text_error_policy {};\n```\n\n### Class text_permissive_error_policy\n\nThe `class_text_permissive_error_policy` class is a policy class that specifies\nthat substitution characters such as the Unicode replacement character\n`U+FFFD` be substituted in place of errors that occur during encoding and\ndecoding operations initiated through text iterators.  This class satisfies\n`TextErrorPolicy`.\n\n```C++\nclass text_permissive_error_policy : public text_error_policy {};\n```\n\n### Alias text_default_error_policy\n\nThe `text_default_error_policy` alias specifies the default text error policy.\nConforming implementations must alias this to `text_strict_error_policy`, but\nmay have options to select an alternative default policy for environments that\ndo not support exceptions.  The referred class shall satisfy `TextErrorPolicy`.\n\n```C++\nusing text_default_error_policy = text_strict_error_policy;\n```\n\n## Error Status\n\n- [Enum encode_status](#enum-encode_status)\n- [Enum decode_status](#enum-decode_status)\n- [status_ok](#status_ok)\n- [error_occurred](#error_occurred)\n- [status_message](#status_message)\n\n### Enum encode_status\n\nThe `encode_status` enumeration type defines enumerators used to report errors\nthat occur during text encoding operations.\n\nThe `no_error` enumerator indicates that no error has occurred.\n\nThe `invalid_character` enumerator indicates that an attempt was made to encode\na character that was not valid for the encoding.\n\nThe `invalid_state_transition` enumerator indicates that an attempt was made to\nencode a state transition that was not valid for the encoding.\n\n```C++\nenum class encode_status : int {\n  no_error = /* implementation-defined */,\n  invalid_character = /* implementation-defined */,\n  invalid_state_transition = /* implementation-defined */\n};\n```\n\n### Enum decode_status\n\nThe `decode_status` enumeration type defines enumerators used to report errors\nthat occur during text decoding operations.\n\nThe `no_error` enumerator indicates that no error has occurred.\n\nThe `no_character` enumerator indicates that no error has occurred, but that no\ncharacter was decoded for a code unit sequence.  This typically indicates that\nthe code unit sequence represents an encoding state transition such as for an\nescape sequence or byte order marker.\n\nThe `invalid_code_unit_sequence` enumerator indicates that an attempt was made\nto decode an invalid code unit sequence.\n\nThe `underflow` enumerator indicates that the end of the input range was\nencountered before a complete code unit sequence was decoded.\n\n```C++\nenum class decode_status : int {\n  no_error = /* implementation-defined */,\n  no_character = /* implementation-defined */,\n  invalid_code_unit_sequence = /* implementation-defined */,\n  underflow = /* implementation-defined */\n};\n```\n\n### status_ok\n\nThe `status_ok` function returns `true` if the `encode_status` argument value\nis `encode_status::no_error` or if the `decode_status` argument is either of\n`decode_status::no_error` or `decode_status::no_character`.  `false` is\nreturned for all other values.\n\n```C++\nconstexpr inline bool status_ok(encode_status es) noexcept;\nconstexpr inline bool status_ok(decode_status ds) noexcept;\n```\n\n### error_occurred\n\nThe `error_occurred` function returns `false` if the `encode_status` argument\nvalue is `encode_status::no_error` or if the `decode_status` argument is either\nof `decode_status::no_error` or `decode_status::no_character`.  `true` is\nreturned for all other values.\n\n```C++\nconstexpr inline bool error_occurred(encode_status es) noexcept;\nconstexpr inline bool error_occurred(decode_status ds) noexcept;\n```\n\n### status_message\n\nThe `status_message` function returns a pointer to a statically allocated\nstring containing a short description of the value of the `encode_status` or\n`decode_status` argument.\n\n```C++\nconst char* status_message(encode_status es) noexcept;\nconst char* status_message(decode_status ds) noexcept;\n```\n\n## Exceptions\n\n- [Class text_error](#class-text_error)\n- [Class text_encode_error](#class-text_encode_error)\n- [Class text_decode_error](#class-text_decode_error)\n\n### Class text_error\n\nThe `text_error` class defines the base class for the types of objects\nthrown as exceptions to report errors detected during text processing.\n\n```C++\nclass text_error : public std::runtime_error\n{\npublic:\n  using std::runtime_error::runtime_error;\n};\n```\n\n### Class text_encode_error\n\nThe `text_encode_error` class defines the types of objects thrown as exceptions\nto report errors detected during encoding of a [character](#character).  Objects\nof this type are generally thrown in response to an attempt to encode a\n[character](#character) with an invalid [code point](#code-point) value, or to\nencode an invalid state transition.\n\n```C++\nclass text_encode_error : public text_error\n{\npublic:\n  explicit text_encode_error(encode_status es) noexcept;\n\n  const encode_status\u0026 status_code() const noexcept;\n\nprivate:\n  encode_status es; // exposition only\n};\n```\n\n### Class text_decode_error\n\nThe `text_decode_error` class defines the types of objects thrown as exceptions\nto report errors detected during decoding of a [code unit](#code-unit) sequence.\nObjects of this type are generally thrown in response to an attempt to decode\nan ill-formed [code unit](#code-unit) sequence, a [code unit](#code-unit)\nsequence that specifies an invalid [code point](#code-point) value, or a\n[code unit](#code-unit) sequence that specifies an invalid state transition.\n\n```C++\nclass text_decode_error : public text_error\n{\npublic:\n  explicit text_decode_error(decode_status ds) noexcept;\n\n  const decode_status\u0026 status_code() const noexcept;\n\nprivate:\n  decode_status ds; // exposition only\n};\n```\n\n## Type traits\n\n- [code_unit_type_t](#code_unit_type_t)\n- [code_point_type_t](#code_point_type_t)\n- [character_set_type_t](#character_set_type_t)\n- [character_type_t](#character_type_t)\n- [encoding_type_t](#encoding_type_t)\n- [default_encoding_type_t](#default_encoding_type_t)\n\n### code_unit_type_t\n\nThe `code_unit_type_t` type alias template provides convenient means for\nselecting the associated [code unit](#code-unit) type of some other type,\nsuch as an [encoding](#encoding) type that satisfies `TextEncoding`.  The\naliased type is the same as `typename T::code_unit_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using code_unit_type_t = /* implementation-defined */ ;\n```\n\n### code_point_type_t\n\nThe `code_point_type_t` type alias template provides convenient means for\nselecting the associated [code point](#code-point) type of some other type,\nsuch as a type that satisfies `CharacterSet` or `Character`.  The aliased\ntype is the same as `typename T::code_point_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using code_point_type_t = /* implementation-defined */ ;\n```\n\n### character_set_type_t\n\nThe `character_set_type_t` type alias template provides convenient means for\nselecting the associated [character set](#character-set) type of some other\ntype, such as a type that satisfies `Character`.  The aliased type is the same\nas `typename T::character_set_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using character_set_type_t = /* implementation-defined */ ;\n```\n\n### character_type_t\n\nThe `character_type_t` type alias template provides convenient means for\nselecting the associated [character](#character) type of some other type, such\nas a type that satisfies `TextEncoding`.  The aliased type is the same as\n`typename T::character_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using character_type_t = /* implementation-defined */ ;\n```\n\n### encoding_type_t\n\nThe `encoding_type_t` type alias template provides convenient means for\nselecting the associated [encoding](#encoding) type of some other type, such\nas a type that satisfies `TextIterator` or `TextView`.  The aliased type is the\nsame as `typename T::encoding_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using encoding_type_t = /* implementation-defined */ ;\n```\n\n### default_encoding_type_t\n\nThe `default_encoding_type_t` type alias template resolves to the default\n[encoding](#encoding) type, if any, for a given type, such as a type that\nsatisfies `CodeUnit`.  Specializations are provided for the following\ncv-unqualified and reference removed fundamental types.  Otherwise, the alias\nwill attempt to resolve against a `default_encoding_type` member type.\n\nWhen `std::remove_cv_t\u003cstd::remove_reference_t\u003cT\u003e\u003e` is ... | the default encoding is ...\n---------------------------------------------------------- | ---------------------------\n`char` | `execution_character_encoding`\n`wchar_t` | `execution_wide_character_encoding`\n`char16_t` | `char16_character_encoding`\n`char32_t` | `char32_character_encoding`\n\n```C++\ntemplate\u003ctypename T\u003e\n  using default_encoding_type_t = /* implementation-defined */ ;\n```\n\n## Character sets\n\n- [Class any_character_set](#class-any_character_set)\n- [Class basic_execution_character_set](#class-basic_execution_character_set)\n- [Class basic_execution_wide_character_set](#class-basic_execution_wide_character_set)\n- [Class unicode_character_set](#class-unicode_character_set)\n- [Character set type aliases](#character-set-type-aliases)\n\n### Class any_character_set\n\nThe `any_character_set` class provides a generic [character set](#character-set)\ntype used when a specific [character set](#character-set) type is unknown or\nwhen the ability to switch between specific [character sets](#character-set)\nis required.  This class satisfies the `CharacterSet` concept and has an\nimplementation defined `code_point_type` that is able to represent\n[code point](#code-point) values from all of the implementation provided\n[character set](#character-set) types.  The code point returned by\n`get_substitution_code_point` is implementation defined.\n\n\n```C++\nclass any_character_set {\npublic:\n  using code_point_type = /* implementation-defined */;\n\n  static const char* get_name() noexcept {\n    return \"any_character_set\";\n  }\n\n  static constexpr code_point_type get_substitution_code_point() noexcept;\n};\n```\n\n### Class basic_execution_character_set\n\nThe `basic_execution_character_set` class represents the basic execution\ncharacter set specified in `[lex.charset]p3` of the [C++11][ISO/IEC 14882:2011]\nstandard.  This class satisfies the `CharacterSet` concept and has a\n`code_point_type` member type that aliases `char`.  The code point returned by\n`get_substitution_code_point` is the code point for the `'?'` character.\n\n\n```C++\nclass basic_execution_character_set {\npublic:\n  using code_point_type = char;\n\n  static const char* get_name() noexcept {\n    return \"basic_execution_character_set\";\n  }\n\n  static constexpr code_point_type get_substitution_code_point() noexcept;\n};\n```\n\n### Class basic_execution_wide_character_set\n\nThe `basic_execution_wide_character_set` class represents the basic execution\nwide character set specified in `[lex.charset]p3` of the\n[C++11][ISO/IEC 14882:2011] standard.  This class satisfies the `CharacterSet`\nconcept and has a `code_point_type` member type that aliases `wchar_t`.  The\ncode point returned by `get_substitution_code_point` is the code point for the\n`L'?'` character.\n\n\n```C++\nclass basic_execution_wide_character_set {\npublic:\n  using code_point_type = wchar_t;\n\n  static const char* get_name() noexcept {\n    return \"basic_execution_wide_character_set\";\n  }\n\n  static constexpr code_point_type get_substitution_code_point() noexcept;\n};\n```\n\n### Class unicode_character_set\n\nThe `unicode_character_set` class represents the [Unicode]\n[character sets](#character-set).  This class satisfies the `CharacterSet`\nconcept and has a `code_point_type` member type that aliases `char32_t`.\nThe code point returned by `get_substitution_code_point` is the `U+FFFD`\nUnicode replacement character.\n\n\n```C++\nclass unicode_character_set {\npublic:\n  using code_point_type = char32_t;\n\n  static const char* get_name() noexcept {\n    return \"unicode_character_set\";\n  }\n\n  static constexpr code_point_type get_substitution_code_point() noexcept;\n};\n```\n\n### Character set type aliases\n\nThe `execution_character_set`,\n`execution_wide_character_set`, and\n`universal_character_set` type aliases reflect the implementation\ndefined execution, wide execution, and universal\n[character sets](#character-set) specified in `[lex.charset]p2-3` of the C++\nstandard.\n\nThe [character set](#character-set) aliased by `execution_character_set` must be\na superset of the `basic_execution_character_set`\n[character set](#character-set).  This alias refers to the\n[character set](#character-set) that the compiler assumes during\ntranslation; the [character set](#character-set) that the compiler uses when\ntranslating [characters](#character) specified by universal-character-name\ndesignators in ordinary string literals, not the locale sensitive run-time\nexecution [character set](#character-set).\n\nThe [character set](#character-set) aliased by `execution_wide_character_set`\nmust be a superset of the `basic_execution_wide_character_set`\n[character set](#character-set).  This alias refers to the\n[character set](#character-set)  that the compiler assumes during\ntranslation; the [character set](#character-set) that the compiler uses when\ntranslating [characters](#character) specified by universal-character-name\ndesignators in wide string literals, not the locale sensitive run-time\nexecution wide [character set](#character-set).\n\nThe [character set](#character-set) aliased by `universal_character_set` must\nbe a superset of the `unicode_character_set` [character set](#character-set).\n\n```C++\nusing execution_character_set = /* implementation-defined */ ;\nusing execution_wide_character_set = /* implementation-defined */ ;\nusing universal_character_set = /* implementation-defined */ ;\n```\n\n## Character set identification\n\n- [Class character_set_id](#class-character_set_id)\n- [get_character_set_id](#get_character_set_id)\n\n### Class character_set_id\n\nThe `character_set_id` class provides unique, opaque values used to identify\n[character sets](#character-set) at run-time.  Values of this type are produced\nby `get_character_set_id()` and can be passed to `get_character_set_info()` to\nobtain [character set](#character-set) information.  Values of this type are\ncopy constructible, copy assignable, equality comparable, and strictly totally\nordered.\n\n```C++\nclass character_set_id {\npublic:\n  character_set_id() = delete;\n\n  friend bool operator==(character_set_id lhs, character_set_id rhs) noexcept;\n  friend bool operator!=(character_set_id lhs, character_set_id rhs) noexcept;\n\n  friend bool operator\u003c(character_set_id lhs, character_set_id rhs) noexcept;\n  friend bool operator\u003e(character_set_id lhs, character_set_id rhs) noexcept;\n  friend bool operator\u003c=(character_set_id lhs, character_set_id rhs) noexcept;\n  friend bool operator\u003e=(character_set_id lhs, character_set_id rhs) noexcept;\n};\n```\n\n### get_character_set_id\n\n`get_character_set_id()` returns a unique, opaque value for the\n[character set](#character-set) type specified by the template parameter.\n\n```C++\ntemplate\u003cCharacterSet CST\u003e\n  inline character_set_id get_character_set_id();\n```\n\n## Character set information\n\n- [Class character_set_info](#class-character_set_info)\n- [get_character_set_info](#get_character_set_info)\n\n### Class character_set_info\n\nThe `character_set_info` class stores information about a\n[character set](#character-set).  Values of this type are produced by the\n`get_character_set_info()` functions based on a [character set](#character-set)\ntype or ID.\n\n```C++\nclass character_set_info {\npublic:\n  character_set_info() = delete;\n\n  character_set_id get_id() const noexcept;\n\n  const char* get_name() const noexcept;\n\nprivate:\n  character_set_id id; // exposition only\n};\n```\n\n### get_character_set_info\n\nThe `get_character_set_info()` functions return a reference to a\n`character_set_info` object based on a [character set](#character-set) type or\nID.\n\n```C++\nconst character_set_info\u0026 get_character_set_info(character_set_id id);\n\ntemplate\u003cCharacterSet CST\u003e\n  inline const character_set_info\u0026 get_character_set_info();\n```\n\n## Characters\n\n- [Class template character](#class-template-character)\n\n### Class template character\n\nObjects of `character` class template specialization type define a\n[character](#character) via the association of a [code point](#code-point)\nvalue and a [character set](#character-set).  The specialization provided for\nthe `any_character_set` type is used to maintain a dynamic\n[character set](#character-set) association while specializations for other\n[character sets](#character-set) specify a static association.  These types\nsatisfy the `Character` concept and are default constructible, copy\nconstructible, copy assignable, and equality comparable.  Member functions\nprovide access to the [code point](#code-point) and\n[character set](#character-set) ID values for the represented\n[character](#character).  Default constructed objects represent a null\n[character](#character) using a zero initialized [code point](#code-point)\nvalue.\n\nObjects with different [character set](#character-set) type are not equality\ncomparable with the exception that objects with a static\n[character set](#character-set) type of `any_character_set` are comparable with\nobjects with any static [character set](#character-set) type.  In this case,\nobjects compare equally if and only if their [character set](#character-set)\nID and [code point](#code-point) values match.  Equality comparison between\nobjects with different static [character set](#character-set) type is not\nimplemented to avoid potentially costly unintended implicit transcoding between\n[character sets](#character-set).\n\n```C++\ntemplate\u003cCharacterSet CST\u003e\nclass character {\npublic:\n  using character_set_type = CST;\n  using code_point_type = code_point_type_t\u003ccharacter_set_type\u003e;\n\n  character() = default;\n  explicit character(code_point_type code_point) noexcept;\n\n  friend bool operator==(const character \u0026lhs,\n                         const character \u0026rhs) noexcept;\n  friend bool operator!=(const character \u0026lhs,\n                         const character \u0026rhs) noexcept;\n\n  void set_code_point(code_point_type code_point) noexcept;\n  code_point_type get_code_point() const noexcept;\n\n  static character_set_id get_character_set_id();\n\nprivate:\n  code_point_type code_point; // exposition only\n};\n\ntemplate\u003c\u003e\nclass character\u003cany_character_set\u003e {\npublic:\n  using character_set_type = any_character_set;\n  using code_point_type = code_point_type_t\u003ccharacter_set_type\u003e;\n\n  character() = default;\n  explicit character(code_point_type code_point) noexcept;\n  character(character_set_id cs_id, code_point_type code_point) noexcept;\n\n  friend bool operator==(const character \u0026lhs,\n                         const character \u0026rhs) noexcept;\n  friend bool operator!=(const character \u0026lhs,\n                         const character \u0026rhs) noexcept;\n\n  void set_code_point(code_point_type code_point) noexcept;\n  code_point_type get_code_point() const noexcept;\n\n  void set_character_set_id(character_set_id new_cs_id) noexcept;\n  character_set_id get_character_set_id() const noexcept;\n\nprivate:\n  character_set_id cs_id;     // exposition only\n  code_point_type code_point; // exposition only\n};\n\ntemplate\u003cCharacterSet CST\u003e\n  bool operator==(const character\u003cany_character_set\u003e \u0026lhs,\n                  const character\u003cCST\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator==(const character\u003cCST\u003e \u0026lhs,\n                  const character\u003cany_character_set\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator!=(const character\u003cany_character_set\u003e \u0026lhs,\n                  const character\u003cCST\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator!=(const character\u003cCST\u003e \u0026lhs,\n                  const character\u003cany_character_set\u003e \u0026rhs);\n```\n\n## Encodings\n\n- [class trivial_encoding_state](#class-trivial_encoding_state)\n- [class trivial_encoding_state_transition](#class-trivial_encoding_state_transition)\n- [Class basic_execution_character_encoding](#class-basic_execution_character_encoding)\n- [Class basic_execution_wide_character_encoding](#class-basic_execution_wide_character_encoding)\n- [Class iso_10646_wide_character_encoding](#class-iso_10646_wide_character_encoding)\n- [Class utf8_encoding](#class-utf8_encoding)\n- [Class utf8bom_encoding](#class-utf8bom_encoding)\n- [Class utf16_encoding](#class-utf16_encoding)\n- [Class utf16be_encoding](#class-utf16be_encoding)\n- [Class utf16le_encoding](#class-utf16le_encoding)\n- [Class utf16bom_encoding](#class-utf16bom_encoding)\n- [Class utf32_encoding](#class-utf32_encoding)\n- [Class utf32be_encoding](#class-utf32be_encoding)\n- [Class utf32le_encoding](#class-utf32le_encoding)\n- [Class utf32bom_encoding](#class-utf32bom_encoding)\n- [Encoding type aliases](#encoding-type-aliases)\n\n### Class trivial_encoding_state\n\nThe `trivial_encoding_state` class is an empty class used by stateless\n[encodings](#encoding) to implement the parts of the generic\n[encoding](#encoding) interfaces necessary to support stateful\n[encodings](#encoding).\n\n```C++\nclass trivial_encoding_state {};\n```\n\n### Class trivial_encoding_state_transition\n\nThe `trivial_encoding_state_transition` class is an empty class used by\nstateless [encodings](#encoding) to implement the parts of the generic\n[encoding](#encoding) interfaces necessary to support stateful\n[encodings](#encoding) that support non-[code-point](#code-point)\nencoding [code unit](#code-unit) sequences.\n\n```C++\nclass trivial_encoding_state_transition {};\n```\n\n### Class basic_execution_character_encoding\n\nThe `basic_execution_character_encoding` class implements support for the\n[encoding](#encoding) used for ordinary string literals limited to support\nfor the basic execution character set as defined in `[lex.charset]p3` of\nthe C++ standard.\n\nThis [encoding](#encoding) is trivial, stateless, fixed width, supports\nrandom access decoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass basic_execution_character_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cbasic_execution_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 1;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class basic_execution_wide_character_encoding\n\nThe `basic_execution_wide_character_encoding` class implements support for the\n[encoding](#encoding) used for wide string literals limited to support for the\nbasic execution wide-character set as defined in `[lex.charset]p3` of\nthe C++ standard.\n\nThis [encoding](#encoding) is trivial, stateless, fixed width, supports\nrandom access decoding, and has a [code unit](#code-unit) of type `wchar_t`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass basic_execution_wide_character_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cbasic_execution_wide_character_set\u003e;\n  using code_unit_type = wchar_t;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 1;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class iso_10646_wide_character_encoding\n\nThe `iso_10646_wide_character_encoding` class is only defined\nwhen the `__STDC_ISO_10646__` macro is defined.\n\nThe `iso_10646_wide_character_encoding` class implements support for the\n[encoding](#encoding) used for wide string literals when that\n[encoding](#encoding) uses the [Unicode] [character set](#character-set) and\n`wchar_t` is large enough to store the [code point](#code-point) values of\nall [characters](#character) defined by the version of the [Unicode] standard\nindicated by the value of the `__STDC_ISO_10646__` macro as specified in\n`[cpp.predefined]p2` of the C++ standard.\n\nThis [encoding](#encoding) is trivial, stateless, fixed width, supports random\naccess decoding, and has a [code unit](#code-unit) of type `wchar_t`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\n#if defined(__STDC_ISO_10646__)\nclass iso_10646_wide_character_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = wchar_t;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 1;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n#endif // __STDC_ISO_10646__\n```\n\n### Class utf8_encoding\n\nThe `utf8_encoding` class implements support for the [Unicode] UTF-8\n[encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf8_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003cstd::make_unsigned_t\u003ccode_unit_type\u003e\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003cstd::make_unsigned_t\u003ccode_unit_type\u003e\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf8bom_encoding\n\nThe `utf8bom_encoding` class implements support for the [Unicode] UTF-8\n[encoding](#encoding) with a byte order mark (BOM).\n\nThis [encoding](#encoding) is stateful, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\nThis [encoding](#encoding) defines a state transition class that enables\nforcing or suppressing the encoding of a BOM, or influencing whether a decoded\nBOM [code unit](#code-unit) sequence represents a BOM or a\n[code point](#code-point).\n\n```C++\nclass utf8bom_encoding_state {\n  /* implementation-defined */\n};\n\nclass utf8bom_encoding_state_transition {\npublic:\n  static utf8bom_encoding_state_transition to_initial_state() noexcept;\n  static utf8bom_encoding_state_transition to_bom_written_state() noexcept;\n  static utf8bom_encoding_state_transition to_assume_bom_written_state() noexcept;\n};\n\nclass utf8bom_encoding {\npublic:\n  using state_type = utf8bom_encoding_state;\n  using state_transition_type = utf8bom_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003cstd::make_unsigned_t\u003ccode_unit_type\u003e\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003cstd::make_unsigned_t\u003ccode_unit_type\u003e\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf16_encoding\n\nThe `utf16_encoding` class implements support for the [Unicode] UTF-16\n[encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char16_t`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf16_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char16_t;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 2;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf16be_encoding\n\nThe `utf16be_encoding` class implements support for the [Unicode] UTF-16\nbig-endian [encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf16be_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 2;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf16le_encoding\n\nThe `utf16le_encoding` class implements support for the [Unicode] UTF-16\nlittle-endian [encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf16le_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 2;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf16bom_encoding\n\nThe `utf16bom_encoding_state` class implements support for the [Unicode] UTF-16\n[encoding](#encoding) with a byte order mark (BOM).\n\nThis [encoding](#encoding) is stateful, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\nThis [encoding](#encoding) defines a state transition class that enables\nforcing or suppressing the encoding of a BOM, or influencing whether a decoded\nBOM [code unit](#code-unit) sequence represents a BOM or a\n[code point](#code-point).\n\n```C++\nclass utf16bom_encoding_state {\n  /* implementation-defined */\n};\n\nclass utf16bom_encoding_state_transition {\npublic:\n  static utf16bom_encoding_state_transition to_initial_state() noexcept;\n  static utf16bom_encoding_state_transition to_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_be_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_le_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_assume_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_assume_be_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_assume_le_bom_written_state() noexcept;\n};\n\nclass utf16bom_encoding {\npublic:\n  using state_type = utf16bom_encoding_state;\n  using state_transition_type = utf16bom_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 2;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf32_encoding\n\nThe `utf32_encoding` class implements support for the [Unicode] UTF-32\n[encoding](#encoding).\n\nThis [encoding](#encoding) is trivial, stateless, fixed width, supports\nrandom access decoding, and has a [code unit](#code-unit) of type `char32_t`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf32_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char32_t;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 1;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf32be_encoding\n\nThe `utf32be_encoding` class implements support for the [Unicode] UTF-32\nbig-endian [encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, fixed width, supports random access\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf32be_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 4;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf32le_encoding\n\nThe `utf32le_encoding` class implements support for the [Unicode] UTF-32\nlittle-endian [encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, fixed width, supports random access\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf32le_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 4;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf32bom_encoding\n\nThe `utf32bom_encoding` class implements support for the [Unicode] UTF-32\n[encoding](#encoding) with a byte order mark (BOM).\n\nThis [encoding](#encoding) is stateful, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\nThis [encoding](#encoding) defines a state transition class that enables\nforcing or suppressing the encoding of a BOM, or influencing whether a decoded\nBOM [code unit](#code-unit) sequence represents a BOM or a\n[code point](#code-point).\n\n```C++\nclass utf32bom_encoding_state {\n  /* implementation-defined */\n};\n\nclass utf32bom_encoding_state_transition {\npublic:\n  static utf32bom_encoding_state_transition to_initial_state() noexcept;\n  static utf32bom_encoding_state_transition to_bom_written_state() noexcept;\n  static utf32bom_encoding_state_transition to_be_bom_written_state() noexcept;\n  static utf32bom_encoding_state_transition to_le_bom_written_state() noexcept;\n  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftahonermann%2Ftext_view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftahonermann%2Ftext_view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftahonermann%2Ftext_view/lists"}