Wide Execution

This is the locale-based, wide runtime encoding. It uses a number of compile-time and runtime heuristics to eventually be resolved to an implementation-defined encoding. It is not required to work in constant expressions either: for this, use ztd::text::wide_literal, which represents the compile-time wide string (e.g. L"my string") encoding.

Currently, the hierachy of behaviors is like so:

  • If the platform is Windows, then it assumes this is UTF-16;

  • If the platform is MacOS or __STDC_ISO10646__, then it assumed this is UTF-32 of some kind;

  • Otherwise, cuneicode is used.

Warning

The C Standard Library has many design defects in its production of code points, which may make it unsuitable even if your C Standard Library recognizes certain locales (e.g., Big5-HKSCS). The runtime will always attempt to load iconv if the definition is turned on, since it may do a better job than the C Standard Library’s interfaces until C23.

Even if, on a given platform, it can be assumed to be a static encoding (e.g., Apple/MacOS where it always returns the “C” Locale but processes text as UTF-32), ztd::text::wide_execution will always present itself as a runtime and unknowable encoding. This is to prevent portability issues from relying on, e.g., ztd::text::is_decode_injective_v<ztd::text::wide_execution> being true during development and working with that assumption, only to have it break when ported to a platform where that assumption no longer holds.

Warning

doxygenvariable: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/ztdtext/checkouts/latest/documentation/source/_build/cmake-build/documentation/doxygen/xml/index.xml

Warning

doxygenclass: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/ztdtext/checkouts/latest/documentation/source/_build/cmake-build/documentation/doxygen/xml/index.xml

Internal Type

Warning

⚠️ Names with double underscores, and within the __*detail and __*impl namespaces are reserved for the implementation. Referencing this entity directly is bad, and the name/functionality can be changed at any point in the future. Relying on anything not guaranteed by the documentation is ☢️☢️Undefined Behavior☢️☢️.

<cwchar>-based

Warning

doxygenclass: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/ztdtext/checkouts/latest/documentation/source/_build/cmake-build/documentation/doxygen/xml/index.xml

MacOS-based / __STDC_ISO106464__-based

Warning

doxygenclass: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/ztdtext/checkouts/latest/documentation/source/_build/cmake-build/documentation/doxygen/xml/index.xml

Windows-based

Warning

doxygenclass: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/ztdtext/checkouts/latest/documentation/source/_build/cmake-build/documentation/doxygen/xml/index.xml