unicode.h.xml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <chapter xml:id="unicode.h">
  2. <title><tt>__vic/unicode.h</tt></title>
  3. <p><link href="https://www.unicode.org/">Unicode</link> support utilities.</p>
  4. <chapter xml:id="unicode_t">
  5. <title><tt>unicode_t</tt></title>
  6. <code-block lang="C++">
  7. using unicode_t = char32_t; // since C++11
  8. // or
  9. using unicode_t = uint_least32_t; // C++98
  10. </code-block>
  11. <p>Type able to store any Unicode
  12. <link href="https://www.unicode.org/glossary/#code_point">code point</link>.</p>
  13. </chapter>
  14. <chapter xml:id="utf_transcode">
  15. <title><tt>utf_transcode()</tt></title>
  16. <code-block lang="C++"><![CDATA[
  17. template<class UTFReader, class UTFWriter>
  18. void utf_transcode(UTFReader r, UTFWriter w);
  19. ]]></code-block>
  20. <p>An algorithm that reads all code points of type <xref to="unicode_t"/> from
  21. <tt>UTFReader</tt> using <tt>r.read()</tt> and writes them to <tt>UTFWriter</tt>
  22. using <tt>w.write()</tt>.</p>
  23. </chapter>
  24. <chapter xml:id="unicode_code_point_constants">
  25. <title><tt>Code point constants</tt></title>
  26. <code-block lang="C++">
  27. constexpr unicode_t unicode_max = 0x10FFFF;
  28. constexpr unicode_t unicode_bom = 0xFEFF;
  29. constexpr unicode_t unicode_replacement_char = 0xFFFD;
  30. </code-block>
  31. <p>Named constants for some useful Unicode code points.</p>
  32. </chapter>
  33. </chapter>