Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-release > by-pkgid > 3a4e91bde08970529a0aa07935652fe8 > files > 1062

icu-doc-58.2-3.mga6.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ICU 58.2: utf8.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ICU 58.2
   &#160;<span id="projectnumber">58.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li><li class="navelem"><a class="el" href="dir_30087b5439e04c85304dbcf15650710b.html">common</a></li><li class="navelem"><a class="el" href="dir_8bf9c54ed6ca2fd1e2117fb037e4ad06.html">unicode</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">utf8.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>C API: 8-bit Unicode handling macros.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="umachine_8h_source.html">unicode/umachine.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="utf_8h_source.html">unicode/utf.h</a>&quot;</code><br />
</div>
<p><a href="utf8_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ae534bfef078b4f5d09e8da543a779db7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#ae534bfef078b4f5d09e8da543a779db7">U8_COUNT_TRAIL_BYTES</a>(leadByte)</td></tr>
<tr class="memdesc:ae534bfef078b4f5d09e8da543a779db7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Counts the trail bytes for a UTF-8 lead byte.  <a href="#ae534bfef078b4f5d09e8da543a779db7">More...</a><br /></td></tr>
<tr class="separator:ae534bfef078b4f5d09e8da543a779db7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32281421a1d07ef0de83e7f44c5d7ba2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a32281421a1d07ef0de83e7f44c5d7ba2">U8_COUNT_TRAIL_BYTES_UNSAFE</a>(leadByte)&#160;&#160;&#160;(((leadByte)&gt;=0xc0)+((leadByte)&gt;=0xe0)+((leadByte)&gt;=0xf0))</td></tr>
<tr class="memdesc:a32281421a1d07ef0de83e7f44c5d7ba2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Counts the trail bytes for a UTF-8 lead byte of a valid UTF-8 sequence.  <a href="#a32281421a1d07ef0de83e7f44c5d7ba2">More...</a><br /></td></tr>
<tr class="separator:a32281421a1d07ef0de83e7f44c5d7ba2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8ed1045986b8bf27814e9bc78388961"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#ae8ed1045986b8bf27814e9bc78388961">U8_MASK_LEAD_BYTE</a>(leadByte,  countTrailBytes)&#160;&#160;&#160;((leadByte)&amp;=(1&lt;&lt;(6-(countTrailBytes)))-1)</td></tr>
<tr class="memdesc:ae8ed1045986b8bf27814e9bc78388961"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value.  <a href="#ae8ed1045986b8bf27814e9bc78388961">More...</a><br /></td></tr>
<tr class="separator:ae8ed1045986b8bf27814e9bc78388961"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f3a9427d880458a9fa6b169a3cc1b3c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a8f3a9427d880458a9fa6b169a3cc1b3c">U8_IS_SINGLE</a>(c)&#160;&#160;&#160;(((c)&amp;0x80)==0)</td></tr>
<tr class="memdesc:a8f3a9427d880458a9fa6b169a3cc1b3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does this code unit (byte) encode a code point by itself (US-ASCII 0..0x7f)?  <a href="#a8f3a9427d880458a9fa6b169a3cc1b3c">More...</a><br /></td></tr>
<tr class="separator:a8f3a9427d880458a9fa6b169a3cc1b3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb9837ea38dd811524a5b761ddc2a2ca"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#adb9837ea38dd811524a5b761ddc2a2ca">U8_IS_LEAD</a>(c)&#160;&#160;&#160;((uint8_t)((c)-0xc0)&lt;0x3e)</td></tr>
<tr class="memdesc:adb9837ea38dd811524a5b761ddc2a2ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is this code unit (byte) a UTF-8 lead byte?  <a href="#adb9837ea38dd811524a5b761ddc2a2ca">More...</a><br /></td></tr>
<tr class="separator:adb9837ea38dd811524a5b761ddc2a2ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afed9fc9bf480bf15a2e6051774f2d80e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a>(c)&#160;&#160;&#160;(((c)&amp;0xc0)==0x80)</td></tr>
<tr class="memdesc:afed9fc9bf480bf15a2e6051774f2d80e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is this code unit (byte) a UTF-8 trail byte?  <a href="#afed9fc9bf480bf15a2e6051774f2d80e">More...</a><br /></td></tr>
<tr class="separator:afed9fc9bf480bf15a2e6051774f2d80e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1730b8bbb3053465ee58702821846f1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#af1730b8bbb3053465ee58702821846f1">U8_LENGTH</a>(c)</td></tr>
<tr class="memdesc:af1730b8bbb3053465ee58702821846f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">How many code units (bytes) are used for the UTF-8 encoding of this Unicode code point?  <a href="#af1730b8bbb3053465ee58702821846f1">More...</a><br /></td></tr>
<tr class="separator:af1730b8bbb3053465ee58702821846f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2298b48749d9f45772c8f5a6885464a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#aa2298b48749d9f45772c8f5a6885464a">U8_MAX_LENGTH</a>&#160;&#160;&#160;4</td></tr>
<tr class="memdesc:aa2298b48749d9f45772c8f5a6885464a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The maximum number of UTF-8 code units (bytes) per Unicode code point (U+0000..U+10ffff).  <a href="#aa2298b48749d9f45772c8f5a6885464a">More...</a><br /></td></tr>
<tr class="separator:aa2298b48749d9f45772c8f5a6885464a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a125e5e7a4ef2f3f57b078f706b2b67f8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a125e5e7a4ef2f3f57b078f706b2b67f8">U8_GET_UNSAFE</a>(s,  i,  c)</td></tr>
<tr class="memdesc:a125e5e7a4ef2f3f57b078f706b2b67f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a random-access offset, without changing the offset.  <a href="#a125e5e7a4ef2f3f57b078f706b2b67f8">More...</a><br /></td></tr>
<tr class="separator:a125e5e7a4ef2f3f57b078f706b2b67f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10a57a084d75604c4a81fb5eec46ae6a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a10a57a084d75604c4a81fb5eec46ae6a">U8_GET</a>(s,  start,  i,  length,  c)</td></tr>
<tr class="memdesc:a10a57a084d75604c4a81fb5eec46ae6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a random-access offset, without changing the offset.  <a href="#a10a57a084d75604c4a81fb5eec46ae6a">More...</a><br /></td></tr>
<tr class="separator:a10a57a084d75604c4a81fb5eec46ae6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad13323ca441892bdb6b49b6954ab9ffb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#ad13323ca441892bdb6b49b6954ab9ffb">U8_GET_OR_FFFD</a>(s,  start,  i,  length,  c)</td></tr>
<tr class="memdesc:ad13323ca441892bdb6b49b6954ab9ffb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a random-access offset, without changing the offset.  <a href="#ad13323ca441892bdb6b49b6954ab9ffb">More...</a><br /></td></tr>
<tr class="separator:ad13323ca441892bdb6b49b6954ab9ffb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28ecdb4233301285fc4ce7f9ea1ed644"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a28ecdb4233301285fc4ce7f9ea1ed644">U8_NEXT_UNSAFE</a>(s,  i,  c)</td></tr>
<tr class="memdesc:a28ecdb4233301285fc4ce7f9ea1ed644"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary.  <a href="#a28ecdb4233301285fc4ce7f9ea1ed644">More...</a><br /></td></tr>
<tr class="separator:a28ecdb4233301285fc4ce7f9ea1ed644"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57f3e5429ae4edb27a42367c627aa482"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a57f3e5429ae4edb27a42367c627aa482">U8_NEXT</a>(s,  i,  length,  c)</td></tr>
<tr class="memdesc:a57f3e5429ae4edb27a42367c627aa482"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary.  <a href="#a57f3e5429ae4edb27a42367c627aa482">More...</a><br /></td></tr>
<tr class="separator:a57f3e5429ae4edb27a42367c627aa482"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dda2b78867c9d648ad5a0f400fdb1b4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a7dda2b78867c9d648ad5a0f400fdb1b4">U8_NEXT_OR_FFFD</a>(s,  i,  length,  c)</td></tr>
<tr class="memdesc:a7dda2b78867c9d648ad5a0f400fdb1b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary.  <a href="#a7dda2b78867c9d648ad5a0f400fdb1b4">More...</a><br /></td></tr>
<tr class="separator:a7dda2b78867c9d648ad5a0f400fdb1b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a154f04764da5af41729c4df6bf9e09f3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a154f04764da5af41729c4df6bf9e09f3">U8_APPEND_UNSAFE</a>(s,  i,  c)</td></tr>
<tr class="memdesc:a154f04764da5af41729c4df6bf9e09f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Append a code point to a string, overwriting 1 to 4 bytes.  <a href="#a154f04764da5af41729c4df6bf9e09f3">More...</a><br /></td></tr>
<tr class="separator:a154f04764da5af41729c4df6bf9e09f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a013997e3d13c501ce73bc45e662881"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a8a013997e3d13c501ce73bc45e662881">U8_APPEND</a>(s,  i,  capacity,  c,  isError)</td></tr>
<tr class="memdesc:a8a013997e3d13c501ce73bc45e662881"><td class="mdescLeft">&#160;</td><td class="mdescRight">Append a code point to a string, overwriting 1 to 4 bytes.  <a href="#a8a013997e3d13c501ce73bc45e662881">More...</a><br /></td></tr>
<tr class="separator:a8a013997e3d13c501ce73bc45e662881"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64a8113aea2125f806cbf5d77294b3cd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a64a8113aea2125f806cbf5d77294b3cd">U8_FWD_1_UNSAFE</a>(s,  i)</td></tr>
<tr class="memdesc:a64a8113aea2125f806cbf5d77294b3cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance the string offset from one code point boundary to the next.  <a href="#a64a8113aea2125f806cbf5d77294b3cd">More...</a><br /></td></tr>
<tr class="separator:a64a8113aea2125f806cbf5d77294b3cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d4c94e845b059fddba0c51e9bad87fd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a6d4c94e845b059fddba0c51e9bad87fd">U8_FWD_1</a>(s,  i,  length)</td></tr>
<tr class="memdesc:a6d4c94e845b059fddba0c51e9bad87fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance the string offset from one code point boundary to the next.  <a href="#a6d4c94e845b059fddba0c51e9bad87fd">More...</a><br /></td></tr>
<tr class="separator:a6d4c94e845b059fddba0c51e9bad87fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e8b4218834110431798cc84a0a664ae"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a8e8b4218834110431798cc84a0a664ae">U8_FWD_N_UNSAFE</a>(s,  i,  n)</td></tr>
<tr class="memdesc:a8e8b4218834110431798cc84a0a664ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points.  <a href="#a8e8b4218834110431798cc84a0a664ae">More...</a><br /></td></tr>
<tr class="separator:a8e8b4218834110431798cc84a0a664ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a311dc48b8aa1050345b886adabf213"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a9a311dc48b8aa1050345b886adabf213">U8_FWD_N</a>(s,  i,  length,  n)</td></tr>
<tr class="memdesc:a9a311dc48b8aa1050345b886adabf213"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points.  <a href="#a9a311dc48b8aa1050345b886adabf213">More...</a><br /></td></tr>
<tr class="separator:a9a311dc48b8aa1050345b886adabf213"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac46a385dbf64c97337522e1d1875a57e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#ac46a385dbf64c97337522e1d1875a57e">U8_SET_CP_START_UNSAFE</a>(s,  i)</td></tr>
<tr class="memdesc:ac46a385dbf64c97337522e1d1875a57e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary at the start of a code point.  <a href="#ac46a385dbf64c97337522e1d1875a57e">More...</a><br /></td></tr>
<tr class="separator:ac46a385dbf64c97337522e1d1875a57e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6d33627a8a5420a8f61e50da2aeca2a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#aa6d33627a8a5420a8f61e50da2aeca2a">U8_SET_CP_START</a>(s,  start,  i)</td></tr>
<tr class="memdesc:aa6d33627a8a5420a8f61e50da2aeca2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary at the start of a code point.  <a href="#aa6d33627a8a5420a8f61e50da2aeca2a">More...</a><br /></td></tr>
<tr class="separator:aa6d33627a8a5420a8f61e50da2aeca2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f78eb19a6b25f61dccbae45d6ecf955"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a5f78eb19a6b25f61dccbae45d6ecf955">U8_PREV_UNSAFE</a>(s,  i,  c)</td></tr>
<tr class="memdesc:a5f78eb19a6b25f61dccbae45d6ecf955"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one and get the code point between them.  <a href="#a5f78eb19a6b25f61dccbae45d6ecf955">More...</a><br /></td></tr>
<tr class="separator:a5f78eb19a6b25f61dccbae45d6ecf955"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17287c1f01ce84fdf8852a756643b076"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a17287c1f01ce84fdf8852a756643b076">U8_PREV</a>(s,  start,  i,  c)</td></tr>
<tr class="memdesc:a17287c1f01ce84fdf8852a756643b076"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one and get the code point between them.  <a href="#a17287c1f01ce84fdf8852a756643b076">More...</a><br /></td></tr>
<tr class="separator:a17287c1f01ce84fdf8852a756643b076"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeef5d89106e5cf1c48727100c0b315bd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#aeef5d89106e5cf1c48727100c0b315bd">U8_PREV_OR_FFFD</a>(s,  start,  i,  c)</td></tr>
<tr class="memdesc:aeef5d89106e5cf1c48727100c0b315bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one and get the code point between them.  <a href="#aeef5d89106e5cf1c48727100c0b315bd">More...</a><br /></td></tr>
<tr class="separator:aeef5d89106e5cf1c48727100c0b315bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3969beb6252f8605ab678990c8af2f48"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a3969beb6252f8605ab678990c8af2f48">U8_BACK_1_UNSAFE</a>(s,  i)</td></tr>
<tr class="memdesc:a3969beb6252f8605ab678990c8af2f48"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one.  <a href="#a3969beb6252f8605ab678990c8af2f48">More...</a><br /></td></tr>
<tr class="separator:a3969beb6252f8605ab678990c8af2f48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adac4ee359e6233cb2990b1047fd5be3c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#adac4ee359e6233cb2990b1047fd5be3c">U8_BACK_1</a>(s,  start,  i)</td></tr>
<tr class="memdesc:adac4ee359e6233cb2990b1047fd5be3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one.  <a href="#adac4ee359e6233cb2990b1047fd5be3c">More...</a><br /></td></tr>
<tr class="separator:adac4ee359e6233cb2990b1047fd5be3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa36f62ea4ac87362e376e4cbea10098d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#aa36f62ea4ac87362e376e4cbea10098d">U8_BACK_N_UNSAFE</a>(s,  i,  n)</td></tr>
<tr class="memdesc:aa36f62ea4ac87362e376e4cbea10098d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points.  <a href="#aa36f62ea4ac87362e376e4cbea10098d">More...</a><br /></td></tr>
<tr class="separator:aa36f62ea4ac87362e376e4cbea10098d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0ce585952c8ba4b103fb6b7aea801ba"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#ab0ce585952c8ba4b103fb6b7aea801ba">U8_BACK_N</a>(s,  start,  i,  n)</td></tr>
<tr class="memdesc:ab0ce585952c8ba4b103fb6b7aea801ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points.  <a href="#ab0ce585952c8ba4b103fb6b7aea801ba">More...</a><br /></td></tr>
<tr class="separator:ab0ce585952c8ba4b103fb6b7aea801ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a910ba47de6d82fafc25b5e12f3a68588"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a910ba47de6d82fafc25b5e12f3a68588">U8_SET_CP_LIMIT_UNSAFE</a>(s,  i)</td></tr>
<tr class="memdesc:a910ba47de6d82fafc25b5e12f3a68588"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary after a code point.  <a href="#a910ba47de6d82fafc25b5e12f3a68588">More...</a><br /></td></tr>
<tr class="separator:a910ba47de6d82fafc25b5e12f3a68588"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40fe523809a3a4e647e47513336b81d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a40fe523809a3a4e647e47513336b81d9">U8_SET_CP_LIMIT</a>(s,  start,  i,  length)</td></tr>
<tr class="memdesc:a40fe523809a3a4e647e47513336b81d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary after a code point.  <a href="#a40fe523809a3a4e647e47513336b81d9">More...</a><br /></td></tr>
<tr class="separator:a40fe523809a3a4e647e47513336b81d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a6eaf56eb54abb71eafcc0c347daa821f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a6eaf56eb54abb71eafcc0c347daa821f">utf8_nextCharSafeBody</a> (const uint8_t *s, int32_t *pi, int32_t length, <a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a> c, <a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> strict)</td></tr>
<tr class="memdesc:a6eaf56eb54abb71eafcc0c347daa821f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for handling "next code point" with error-checking.  <a href="#a6eaf56eb54abb71eafcc0c347daa821f">More...</a><br /></td></tr>
<tr class="separator:a6eaf56eb54abb71eafcc0c347daa821f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6cf17491f1c237bbe5b002056b830fd3"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a6cf17491f1c237bbe5b002056b830fd3">utf8_appendCharSafeBody</a> (uint8_t *s, int32_t i, int32_t length, <a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a> c, <a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> *pIsError)</td></tr>
<tr class="memdesc:a6cf17491f1c237bbe5b002056b830fd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for handling "append code point" with error-checking.  <a href="#a6cf17491f1c237bbe5b002056b830fd3">More...</a><br /></td></tr>
<tr class="separator:a6cf17491f1c237bbe5b002056b830fd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2bbae41d2d845750088a17dc55f59096"><td class="memItemLeft" align="right" valign="top"><a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a2bbae41d2d845750088a17dc55f59096">utf8_prevCharSafeBody</a> (const uint8_t *s, int32_t start, int32_t *pi, <a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a> c, <a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> strict)</td></tr>
<tr class="memdesc:a2bbae41d2d845750088a17dc55f59096"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for handling "previous code point" with error-checking.  <a href="#a2bbae41d2d845750088a17dc55f59096">More...</a><br /></td></tr>
<tr class="separator:a2bbae41d2d845750088a17dc55f59096"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4017310e2ecadac7dea5a432a33ccf30"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a4017310e2ecadac7dea5a432a33ccf30">utf8_back1SafeBody</a> (const uint8_t *s, int32_t start, int32_t i)</td></tr>
<tr class="memdesc:a4017310e2ecadac7dea5a432a33ccf30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for handling "skip backward one code point" with error-checking.  <a href="#a4017310e2ecadac7dea5a432a33ccf30">More...</a><br /></td></tr>
<tr class="separator:a4017310e2ecadac7dea5a432a33ccf30"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a4e3ae25d5856272ab60ab87c28572a99"><td class="memItemLeft" align="right" valign="top"><a class="el" href="umachine_8h.html#af702d65cba0638c5a8194cccc8d7c39e">U_CFUNC</a> <a class="el" href="platform_8h.html#a4099e2ee510ce74ddacfc2010306b8b5">U_IMPORT</a> const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf8_8h.html#a4e3ae25d5856272ab60ab87c28572a99">utf8_countTrailBytes</a> [256]</td></tr>
<tr class="memdesc:a4e3ae25d5856272ab60ab87c28572a99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal array with numbers of trail bytes for any given byte used in lead byte position.  <a href="#a4e3ae25d5856272ab60ab87c28572a99">More...</a><br /></td></tr>
<tr class="separator:a4e3ae25d5856272ab60ab87c28572a99"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>C API: 8-bit Unicode handling macros. </p>
<p>This file defines macros to deal with 8-bit Unicode (UTF-8) code units (bytes) and strings.</p>
<p>For more information see <a class="el" href="utf_8h.html" title="C API: Code point macros. ">utf.h</a> and the ICU User Guide Strings chapter (<a href="http://userguide.icu-project.org/strings">http://userguide.icu-project.org/strings</a>).</p>
<p><em>Usage:</em> ICU coding guidelines for if() statements should be followed when using these macros. Compound statements (curly braces {}) must be used for if-else-while... bodies and all macro statements should be terminated with semicolon. </p>

<p>Definition in file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a8a013997e3d13c501ce73bc45e662881"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_APPEND</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">capacity, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">isError&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if((uint32_t)(c)&lt;=0x7f) { \</div><div class="line">        (s)[(i)++]=(uint8_t)(c); \</div><div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span>((uint32_t)(c)&lt;=0x7ff &amp;&amp; (i)+1&lt;(capacity)) { \</div><div class="line">        (s)[(i)++]=(uint8_t)(((c)&gt;&gt;6)|0xc0); \</div><div class="line">        (s)[(i)++]=(uint8_t)(((c)&amp;0x3f)|0x80); \</div><div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span>((uint32_t)(c)&lt;=0xd7ff &amp;&amp; (i)+2&lt;(capacity)) { \</div><div class="line">        (s)[(i)++]=(uint8_t)(((c)&gt;&gt;12)|0xe0); \</div><div class="line">        (s)[(i)++]=(uint8_t)((((c)&gt;&gt;6)&amp;0x3f)|0x80); \</div><div class="line">        (s)[(i)++]=(uint8_t)(((c)&amp;0x3f)|0x80); \</div><div class="line">    } <span class="keywordflow">else</span> { \</div><div class="line">        (i)=<a class="code" href="utf8_8h.html#a6cf17491f1c237bbe5b002056b830fd3">utf8_appendCharSafeBody</a>(s, (i), (capacity), c, &amp;(isError)); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a6cf17491f1c237bbe5b002056b830fd3"><div class="ttname"><a href="utf8_8h.html#a6cf17491f1c237bbe5b002056b830fd3">utf8_appendCharSafeBody</a></div><div class="ttdeci">int32_t utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, UBool *pIsError)</div><div class="ttdoc">Function for handling &quot;append code point&quot; with error-checking. </div></div>
</div><!-- fragment -->
<p>Append a code point to a string, overwriting 1 to 4 bytes. </p>
<p>The offset points to the current end of the string contents and is advanced (post-increment). "Safe" macro, checks for a valid code point. If a non-ASCII code point is written, checks for sufficient space in the string. If the code point is not valid or trail bytes do not fit, then isError is set to TRUE.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string buffer </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be i&lt;capacity </td></tr>
    <tr><td class="paramname">capacity</td><td>int32_t size of the string buffer </td></tr>
    <tr><td class="paramname">c</td><td>UChar32 code point to append </td></tr>
    <tr><td class="paramname">isError</td><td>output UBool set to TRUE if an error occurs, otherwise not modified </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a154f04764da5af41729c4df6bf9e09f3" title="Append a code point to a string, overwriting 1 to 4 bytes. ">U8_APPEND_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002931">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00471">471</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a154f04764da5af41729c4df6bf9e09f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_APPEND_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if((uint32_t)(c)&lt;=0x7f) { \</div><div class="line">        (s)[(i)++]=(uint8_t)(c); \</div><div class="line">    } <span class="keywordflow">else</span> { \</div><div class="line">        if((uint32_t)(c)&lt;=0x7ff) { \</div><div class="line">            (s)[(i)++]=(uint8_t)(((c)&gt;&gt;6)|0xc0); \</div><div class="line">        } <span class="keywordflow">else</span> { \</div><div class="line">            if((uint32_t)(c)&lt;=0xffff) { \</div><div class="line">                (s)[(i)++]=(uint8_t)(((c)&gt;&gt;12)|0xe0); \</div><div class="line">            } <span class="keywordflow">else</span> { \</div><div class="line">                (s)[(i)++]=(uint8_t)(((c)&gt;&gt;18)|0xf0); \</div><div class="line">                (s)[(i)++]=(uint8_t)((((c)&gt;&gt;12)&amp;0x3f)|0x80); \</div><div class="line">            } \</div><div class="line">            (s)[(i)++]=(uint8_t)((((c)&gt;&gt;6)&amp;0x3f)|0x80); \</div><div class="line">        } \</div><div class="line">        (s)[(i)++]=(uint8_t)(((c)&amp;0x3f)|0x80); \</div><div class="line">    } \</div><div class="line">}</div></div><!-- fragment -->
<p>Append a code point to a string, overwriting 1 to 4 bytes. </p>
<p>The offset points to the current end of the string contents and is advanced (post-increment). "Unsafe" macro, assumes a valid code point and sufficient space in the string. Otherwise, the result is undefined.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string buffer </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">c</td><td>code point to append </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a8a013997e3d13c501ce73bc45e662881" title="Append a code point to a string, overwriting 1 to 4 bytes. ">U8_APPEND</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002930">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00435">435</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="adac4ee359e6233cb2990b1047fd5be3c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_BACK_1</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a>((s)[--(i)])) { \</div><div class="line">        (i)=<a class="code" href="utf8_8h.html#a4017310e2ecadac7dea5a432a33ccf30">utf8_back1SafeBody</a>(s, start, (i)); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_afed9fc9bf480bf15a2e6051774f2d80e"><div class="ttname"><a href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a></div><div class="ttdeci">#define U8_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit (byte) a UTF-8 trail byte? </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00182">utf8.h:182</a></div></div>
<div class="ttc" id="utf8_8h_html_a4017310e2ecadac7dea5a432a33ccf30"><div class="ttname"><a href="utf8_8h.html#a4017310e2ecadac7dea5a432a33ccf30">utf8_back1SafeBody</a></div><div class="ttdeci">int32_t utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i)</div><div class="ttdoc">Function for handling &quot;skip backward one code point&quot; with error-checking. </div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one. </p>
<p>(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be start&lt;i </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a3969beb6252f8605ab678990c8af2f48" title="Move the string offset from one code point boundary to the previous one. ">U8_BACK_1_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002942">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00735">735</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3969beb6252f8605ab678990c8af2f48"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_BACK_1_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    while(<a class="code" href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a>((s)[--(i)])) {} \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_afed9fc9bf480bf15a2e6051774f2d80e"><div class="ttname"><a href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a></div><div class="ttdeci">#define U8_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit (byte) a UTF-8 trail byte? </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00182">utf8.h:182</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one. </p>
<p>(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-8.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#adac4ee359e6233cb2990b1047fd5be3c" title="Move the string offset from one code point boundary to the previous one. ">U8_BACK_1</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002941">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00719">719</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab0ce585952c8ba4b103fb6b7aea801ba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_BACK_N</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">n&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t __N=(n); \</div><div class="line">    while(__N&gt;0 &amp;&amp; (i)&gt;(start)) { <a class="code" href="utf8_8h.html#adac4ee359e6233cb2990b1047fd5be3c">\</a></div><div class="line"><a class="code" href="utf8_8h.html#adac4ee359e6233cb2990b1047fd5be3c">        U8_BACK_1</a>(s, start, i); \</div><div class="line">        --__N; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_adac4ee359e6233cb2990b1047fd5be3c"><div class="ttname"><a href="utf8_8h.html#adac4ee359e6233cb2990b1047fd5be3c">U8_BACK_1</a></div><div class="ttdeci">#define U8_BACK_1(s, start, i)</div><div class="ttdoc">Move the string offset from one code point boundary to the previous one. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00735">utf8.h:735</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points. </p>
<p>(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t index of the start of the string </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be start&lt;i </td></tr>
    <tr><td class="paramname">n</td><td>number of code points to skip </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#aa36f62ea4ac87362e376e4cbea10098d" title="Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points. ">U8_BACK_N_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002944">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00776">776</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa36f62ea4ac87362e376e4cbea10098d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_BACK_N_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">n&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t __N=(n); \</div><div class="line">    while(__N&gt;0) { <a class="code" href="utf8_8h.html#a3969beb6252f8605ab678990c8af2f48">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a3969beb6252f8605ab678990c8af2f48">        U8_BACK_1_UNSAFE</a>(s, i); \</div><div class="line">        --__N; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a3969beb6252f8605ab678990c8af2f48"><div class="ttname"><a href="utf8_8h.html#a3969beb6252f8605ab678990c8af2f48">U8_BACK_1_UNSAFE</a></div><div class="ttdeci">#define U8_BACK_1_UNSAFE(s, i)</div><div class="ttdoc">Move the string offset from one code point boundary to the previous one. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00719">utf8.h:719</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points. </p>
<p>(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-8.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">n</td><td>number of code points to skip </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#ab0ce585952c8ba4b103fb6b7aea801ba" title="Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points. ">U8_BACK_N</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002943">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00754">754</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae534bfef078b4f5d09e8da543a779db7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_COUNT_TRAIL_BYTES</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">leadByte</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((uint8_t)(leadByte)&lt;0xf0 ? \</div><div class="line">        ((uint8_t)(leadByte)&gt;=0xc0)+((uint8_t)(leadByte)&gt;=0xe0) : \</div><div class="line">        (uint8_t)(leadByte)&lt;0xfe ? 3+((uint8_t)(leadByte)&gt;=0xf8)+((uint8_t)(leadByte)&gt;=0xfc) : 0)</div></div><!-- fragment -->
<p>Counts the trail bytes for a UTF-8 lead byte. </p>
<p>Returns 0 for 0..0xbf as well as for 0xfe and 0xff.</p>
<p>This is internal since it is not meant to be called directly by external clients; however it is called by public macros in this file and thus must remain stable.</p>
<p>Note: Beginning with ICU 50, the implementation uses a multi-condition expression which was shown in 2012 (on x86-64) to compile to fast, branch-free code. leadByte is evaluated multiple times.</p>
<p>The pre-ICU 50 implementation used the exported array utf8_countTrailBytes: #define <a class="el" href="utf8_8h.html#ae534bfef078b4f5d09e8da543a779db7" title="Counts the trail bytes for a UTF-8 lead byte. ">U8_COUNT_TRAIL_BYTES(leadByte)</a> (utf8_countTrailBytes[leadByte]) leadByte was evaluated exactly once.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">leadByte</td><td>The first byte of a UTF-8 sequence. Must be 0..0xff. </td></tr>
  </table>
  </dd>
</dl>
<dl class="internal"><dt><b><a class="el" href="internal.html#_internal000212">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00082">82</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a32281421a1d07ef0de83e7f44c5d7ba2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_COUNT_TRAIL_BYTES_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">leadByte</td><td>)</td>
          <td>&#160;&#160;&#160;(((leadByte)&gt;=0xc0)+((leadByte)&gt;=0xe0)+((leadByte)&gt;=0xf0))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Counts the trail bytes for a UTF-8 lead byte of a valid UTF-8 sequence. </p>
<p>The maximum supported lead byte is 0xf4 corresponding to U+10FFFF. leadByte might be evaluated multiple times.</p>
<p>This is internal since it is not meant to be called directly by external clients; however it is called by public macros in this file and thus must remain stable.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">leadByte</td><td>The first byte of a UTF-8 sequence. Must be 0..0xff. </td></tr>
  </table>
  </dd>
</dl>
<dl class="internal"><dt><b><a class="el" href="internal.html#_internal000213">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00098">98</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6d4c94e845b059fddba0c51e9bad87fd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_FWD_1</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    uint8_t __b=(uint8_t)(s)[(i)++]; \</div><div class="line">    if(<a class="code" href="utf8_8h.html#adb9837ea38dd811524a5b761ddc2a2ca">U8_IS_LEAD</a>(__b)) { \</div><div class="line">        uint8_t __count=<a class="code" href="utf8_8h.html#ae534bfef078b4f5d09e8da543a779db7">U8_COUNT_TRAIL_BYTES</a>(__b); \</div><div class="line">        if((i)+__count&gt;(length) &amp;&amp; (length)&gt;=0) { \</div><div class="line">            __count=(uint8_t)((length)-(i)); \</div><div class="line">        } \</div><div class="line">        while(__count&gt;0 &amp;&amp; <a class="code" href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a>((s)[i])) { \</div><div class="line">            ++(i); \</div><div class="line">            --__count; \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_adb9837ea38dd811524a5b761ddc2a2ca"><div class="ttname"><a href="utf8_8h.html#adb9837ea38dd811524a5b761ddc2a2ca">U8_IS_LEAD</a></div><div class="ttdeci">#define U8_IS_LEAD(c)</div><div class="ttdoc">Is this code unit (byte) a UTF-8 lead byte? </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00174">utf8.h:174</a></div></div>
<div class="ttc" id="utf8_8h_html_ae534bfef078b4f5d09e8da543a779db7"><div class="ttname"><a href="utf8_8h.html#ae534bfef078b4f5d09e8da543a779db7">U8_COUNT_TRAIL_BYTES</a></div><div class="ttdeci">#define U8_COUNT_TRAIL_BYTES(leadByte)</div><div class="ttdoc">Counts the trail bytes for a UTF-8 lead byte. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00082">utf8.h:82</a></div></div>
<div class="ttc" id="utf8_8h_html_afed9fc9bf480bf15a2e6051774f2d80e"><div class="ttname"><a href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a></div><div class="ttdeci">#define U8_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit (byte) a UTF-8 trail byte? </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00182">utf8.h:182</a></div></div>
</div><!-- fragment -->
<p>Advance the string offset from one code point boundary to the next. </p>
<p>(Post-incrementing iteration.) "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a64a8113aea2125f806cbf5d77294b3cd" title="Advance the string offset from one code point boundary to the next. ">U8_FWD_1_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002933">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00513">513</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a64a8113aea2125f806cbf5d77294b3cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_FWD_1_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (i)+=1+<a class="code" href="utf8_8h.html#a32281421a1d07ef0de83e7f44c5d7ba2">U8_COUNT_TRAIL_BYTES_UNSAFE</a>((uint8_t)(s)[i]); \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a32281421a1d07ef0de83e7f44c5d7ba2"><div class="ttname"><a href="utf8_8h.html#a32281421a1d07ef0de83e7f44c5d7ba2">U8_COUNT_TRAIL_BYTES_UNSAFE</a></div><div class="ttdeci">#define U8_COUNT_TRAIL_BYTES_UNSAFE(leadByte)</div><div class="ttdoc">Counts the trail bytes for a UTF-8 lead byte of a valid UTF-8 sequence. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00098">utf8.h:98</a></div></div>
</div><!-- fragment -->
<p>Advance the string offset from one code point boundary to the next. </p>
<p>(Post-incrementing iteration.) "Unsafe" macro, assumes well-formed UTF-8.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a6d4c94e845b059fddba0c51e9bad87fd" title="Advance the string offset from one code point boundary to the next. ">U8_FWD_1</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002932">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00496">496</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9a311dc48b8aa1050345b886adabf213"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_FWD_N</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">n&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t __N=(n); \</div><div class="line">    while(__N&gt;0 &amp;&amp; ((i)&lt;(length) || ((length)&lt;0 &amp;&amp; (s)[i]!=0))) { <a class="code" href="utf8_8h.html#a6d4c94e845b059fddba0c51e9bad87fd">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a6d4c94e845b059fddba0c51e9bad87fd">        U8_FWD_1</a>(s, i, length); \</div><div class="line">        --__N; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a6d4c94e845b059fddba0c51e9bad87fd"><div class="ttname"><a href="utf8_8h.html#a6d4c94e845b059fddba0c51e9bad87fd">U8_FWD_1</a></div><div class="ttdeci">#define U8_FWD_1(s, i, length)</div><div class="ttdoc">Advance the string offset from one code point boundary to the next. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00513">utf8.h:513</a></div></div>
</div><!-- fragment -->
<p>Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. </p>
<p>(Post-incrementing iteration.) "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
    <tr><td class="paramname">n</td><td>number of code points to skip </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a8e8b4218834110431798cc84a0a664ae" title="Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. ">U8_FWD_N_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002935">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00562">562</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8e8b4218834110431798cc84a0a664ae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_FWD_N_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">n&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t __N=(n); \</div><div class="line">    while(__N&gt;0) { <a class="code" href="utf8_8h.html#a64a8113aea2125f806cbf5d77294b3cd">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a64a8113aea2125f806cbf5d77294b3cd">        U8_FWD_1_UNSAFE</a>(s, i); \</div><div class="line">        --__N; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a64a8113aea2125f806cbf5d77294b3cd"><div class="ttname"><a href="utf8_8h.html#a64a8113aea2125f806cbf5d77294b3cd">U8_FWD_1_UNSAFE</a></div><div class="ttdeci">#define U8_FWD_1_UNSAFE(s, i)</div><div class="ttdoc">Advance the string offset from one code point boundary to the next. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00496">utf8.h:496</a></div></div>
</div><!-- fragment -->
<p>Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. </p>
<p>(Post-incrementing iteration.) "Unsafe" macro, assumes well-formed UTF-8.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">n</td><td>number of code points to skip </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a9a311dc48b8aa1050345b886adabf213" title="Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. ">U8_FWD_N</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002934">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00539">539</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a10a57a084d75604c4a81fb5eec46ae6a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_GET</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t _u8_get_index=(i); <a class="code" href="utf8_8h.html#aa6d33627a8a5420a8f61e50da2aeca2a">\</a></div><div class="line"><a class="code" href="utf8_8h.html#aa6d33627a8a5420a8f61e50da2aeca2a">    U8_SET_CP_START</a>(s, start, _u8_get_index); <a class="code" href="utf8_8h.html#a57f3e5429ae4edb27a42367c627aa482">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a57f3e5429ae4edb27a42367c627aa482">    U8_NEXT</a>(s, _u8_get_index, length, c); \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_aa6d33627a8a5420a8f61e50da2aeca2a"><div class="ttname"><a href="utf8_8h.html#aa6d33627a8a5420a8f61e50da2aeca2a">U8_SET_CP_START</a></div><div class="ttdeci">#define U8_SET_CP_START(s, start, i)</div><div class="ttdoc">Adjust a random-access offset to a code point boundary at the start of a code point. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00601">utf8.h:601</a></div></div>
<div class="ttc" id="utf8_8h_html_a57f3e5429ae4edb27a42367c627aa482"><div class="ttname"><a href="utf8_8h.html#a57f3e5429ae4edb27a42367c627aa482">U8_NEXT</a></div><div class="ttdeci">#define U8_NEXT(s, i, length, c)</div><div class="ttdoc">Get a code point from a string at a code point boundary offset, and advance the offset to the next co...</div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00344">utf8.h:344</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a random-access offset, without changing the offset. </p>
<p>The offset may point to either the lead byte or one of the trail bytes for a code point, in which case the macro will read all of the bytes for the code point.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<p>If the offset points to an illegal UTF-8 byte sequence, then c is set to a negative value. Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_NEXT.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t starting string offset </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be start&lt;=i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable, set to &lt;0 in case of an error </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a125e5e7a4ef2f3f57b078f706b2b67f8" title="Get a code point from a string at a random-access offset, without changing the offset. ">U8_GET_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002925">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00252">252</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad13323ca441892bdb6b49b6954ab9ffb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_GET_OR_FFFD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t _u8_get_index=(i); <a class="code" href="utf8_8h.html#aa6d33627a8a5420a8f61e50da2aeca2a">\</a></div><div class="line"><a class="code" href="utf8_8h.html#aa6d33627a8a5420a8f61e50da2aeca2a">    U8_SET_CP_START</a>(s, start, _u8_get_index); <a class="code" href="utf8_8h.html#a7dda2b78867c9d648ad5a0f400fdb1b4">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a7dda2b78867c9d648ad5a0f400fdb1b4">    U8_NEXT_OR_FFFD</a>(s, _u8_get_index, length, c); \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_aa6d33627a8a5420a8f61e50da2aeca2a"><div class="ttname"><a href="utf8_8h.html#aa6d33627a8a5420a8f61e50da2aeca2a">U8_SET_CP_START</a></div><div class="ttdeci">#define U8_SET_CP_START(s, start, i)</div><div class="ttdoc">Adjust a random-access offset to a code point boundary at the start of a code point. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00601">utf8.h:601</a></div></div>
<div class="ttc" id="utf8_8h_html_a7dda2b78867c9d648ad5a0f400fdb1b4"><div class="ttname"><a href="utf8_8h.html#a7dda2b78867c9d648ad5a0f400fdb1b4">U8_NEXT_OR_FFFD</a></div><div class="ttdeci">#define U8_NEXT_OR_FFFD(s, i, length, c)</div><div class="ttdoc">Get a code point from a string at a code point boundary offset, and advance the offset to the next co...</div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00395">utf8.h:395</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a random-access offset, without changing the offset. </p>
<p>The offset may point to either the lead byte or one of the trail bytes for a code point, in which case the macro will read all of the bytes for the code point.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<p>If the offset points to an illegal UTF-8 byte sequence, then c is set to U+FFFD. Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_NEXT_OR_FFFD.</p>
<p>This macro does not distinguish between a real U+FFFD in the text and U+FFFD returned for an ill-formed sequence. Use <a class="el" href="utf8_8h.html#a10a57a084d75604c4a81fb5eec46ae6a" title="Get a code point from a string at a random-access offset, without changing the offset. ">U8_GET()</a> if that distinction is important.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t starting string offset </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be start&lt;=i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable, set to U+FFFD in case of an error </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a10a57a084d75604c4a81fb5eec46ae6a" title="Get a code point from a string at a random-access offset, without changing the offset. ">U8_GET</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002926">Stable:</a></b></dt><dd>ICU 51 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00283">283</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a125e5e7a4ef2f3f57b078f706b2b67f8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_GET_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t _u8_get_unsafe_index=(int32_t)(i); <a class="code" href="utf8_8h.html#ac46a385dbf64c97337522e1d1875a57e">\</a></div><div class="line"><a class="code" href="utf8_8h.html#ac46a385dbf64c97337522e1d1875a57e">    U8_SET_CP_START_UNSAFE</a>(s, _u8_get_unsafe_index); <a class="code" href="utf8_8h.html#a28ecdb4233301285fc4ce7f9ea1ed644">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a28ecdb4233301285fc4ce7f9ea1ed644">    U8_NEXT_UNSAFE</a>(s, _u8_get_unsafe_index, c); \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_ac46a385dbf64c97337522e1d1875a57e"><div class="ttname"><a href="utf8_8h.html#ac46a385dbf64c97337522e1d1875a57e">U8_SET_CP_START_UNSAFE</a></div><div class="ttdeci">#define U8_SET_CP_START_UNSAFE(s, i)</div><div class="ttdoc">Adjust a random-access offset to a code point boundary at the start of a code point. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00583">utf8.h:583</a></div></div>
<div class="ttc" id="utf8_8h_html_a28ecdb4233301285fc4ce7f9ea1ed644"><div class="ttname"><a href="utf8_8h.html#a28ecdb4233301285fc4ce7f9ea1ed644">U8_NEXT_UNSAFE</a></div><div class="ttdeci">#define U8_NEXT_UNSAFE(s, i, c)</div><div class="ttdoc">Get a code point from a string at a code point boundary offset, and advance the offset to the next co...</div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00308">utf8.h:308</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a random-access offset, without changing the offset. </p>
<p>The offset may point to either the lead byte or one of the trail bytes for a code point, in which case the macro will read all of the bytes for the code point. The result is undefined if the offset points to an illegal UTF-8 byte sequence. Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_NEXT.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a10a57a084d75604c4a81fb5eec46ae6a" title="Get a code point from a string at a random-access offset, without changing the offset. ">U8_GET</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002924">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00225">225</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="adb9837ea38dd811524a5b761ddc2a2ca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_IS_LEAD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;((uint8_t)((c)-0xc0)&lt;0x3e)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Is this code unit (byte) a UTF-8 lead byte? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>8-bit code unit (byte) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002920">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00174">174</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8f3a9427d880458a9fa6b169a3cc1b3c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_IS_SINGLE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;(((c)&amp;0x80)==0)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Does this code unit (byte) encode a code point by itself (US-ASCII 0..0x7f)? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>8-bit code unit (byte) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002919">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00166">166</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="afed9fc9bf480bf15a2e6051774f2d80e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_IS_TRAIL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;(((c)&amp;0xc0)==0x80)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Is this code unit (byte) a UTF-8 trail byte? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>8-bit code unit (byte) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002921">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00182">182</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="af1730b8bbb3053465ee58702821846f1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_LENGTH</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">((uint32_t)(c)&lt;=0x7f ? 1 : \</div><div class="line">        ((uint32_t)(c)&lt;=0x7ff ? 2 : \</div><div class="line">            ((uint32_t)(c)&lt;=0xd7ff ? 3 : \</div><div class="line">                ((uint32_t)(c)&lt;=0xdfff || (uint32_t)(c)&gt;0x10ffff ? 0 : \</div><div class="line">                    ((uint32_t)(c)&lt;=0xffff ? 3 : 4)\</div><div class="line">                ) \</div><div class="line">            ) \</div><div class="line">        ) \</div><div class="line">    )</div></div><!-- fragment -->
<p>How many code units (bytes) are used for the UTF-8 encoding of this Unicode code point? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>32-bit code point </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1..4, or 0 if c is a surrogate or not a Unicode code point </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002922">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00191">191</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae8ed1045986b8bf27814e9bc78388961"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_MASK_LEAD_BYTE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">leadByte, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">countTrailBytes&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((leadByte)&amp;=(1&lt;&lt;(6-(countTrailBytes)))-1)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value. </p>
<p>This is internal since it is not meant to be called directly by external clients; however it is called by public macros in this file and thus must remain stable. </p><dl class="internal"><dt><b><a class="el" href="internal.html#_internal000214">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00108">108</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa2298b48749d9f45772c8f5a6885464a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_MAX_LENGTH&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The maximum number of UTF-8 code units (bytes) per Unicode code point (U+0000..U+10ffff). </p>
<dl class="section return"><dt>Returns</dt><dd>4 </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002923">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00207">207</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a57f3e5429ae4edb27a42367c627aa482"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_NEXT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(uint8_t)(s)[(i)++]; \</div><div class="line">    if((c)&gt;=0x80) { \</div><div class="line">        uint8_t __t1, __t2; \</div><div class="line">        if( <span class="comment">/* handle U+1000..U+CFFF inline */</span> \</div><div class="line">            (0xe0&lt;(c) &amp;&amp; (c)&lt;=0xec) &amp;&amp; \</div><div class="line">            (((i)+1)&lt;(length) || (length)&lt;0) &amp;&amp; \</div><div class="line">            (__t1=(uint8_t)((s)[i]-0x80))&lt;=0x3f &amp;&amp; \</div><div class="line">            (__t2=(uint8_t)((s)[(i)+1]-0x80))&lt;= 0x3f \</div><div class="line">        ) { \</div><div class="line">            <span class="comment">/* no need for (c&amp;0xf) because the upper bits are truncated after &lt;&lt;12 in the cast to (UChar) */</span> \</div><div class="line">            (c)=(<a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((c)&lt;&lt;12)|(__t1&lt;&lt;6)|__t2); \</div><div class="line">            (i)+=2; \</div><div class="line">        } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( <span class="comment">/* handle U+0080..U+07FF inline */</span> \</div><div class="line">            ((c)&lt;0xe0 &amp;&amp; (c)&gt;=0xc2) &amp;&amp; \</div><div class="line">            ((i)!=(length)) &amp;&amp; \</div><div class="line">            (__t1=(uint8_t)((s)[i]-0x80))&lt;=0x3f \</div><div class="line">        ) { \</div><div class="line">            (c)=(((c)&amp;0x1f)&lt;&lt;6)|__t1; \</div><div class="line">            ++(i); \</div><div class="line">        } <span class="keywordflow">else</span> { \</div><div class="line">            <span class="comment">/* function call for &quot;complicated&quot; and error cases */</span> \</div><div class="line">            (c)=<a class="code" href="utf8_8h.html#a6eaf56eb54abb71eafcc0c347daa821f">utf8_nextCharSafeBody</a>((<span class="keyword">const</span> uint8_t *)s, &amp;(i), (length), c, -1); \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a6eaf56eb54abb71eafcc0c347daa821f"><div class="ttname"><a href="utf8_8h.html#a6eaf56eb54abb71eafcc0c347daa821f">utf8_nextCharSafeBody</a></div><div class="ttdeci">UChar32 utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar32 c, UBool strict)</div><div class="ttdoc">Function for handling &quot;next code point&quot; with error-checking. </div></div>
<div class="ttc" id="umachine_8h_html_a6bb9fad572d65b305324ef288165e2ac"><div class="ttname"><a href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a></div><div class="ttdeci">uint16_t UChar</div><div class="ttdoc">Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...</div><div class="ttdef"><b>Definition:</b> <a href="umachine_8h_source.html#l00337">umachine.h:337</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary. </p>
<p>(Post-incrementing forward iteration.) "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<p>The offset may point to the lead byte of a multi-byte sequence, in which case the macro will read the whole sequence. If the offset points to a trail byte or an illegal UTF-8 sequence, then c is set to a negative value.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable, set to &lt;0 in case of an error </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a28ecdb4233301285fc4ce7f9ea1ed644" title="Get a code point from a string at a code point boundary offset, and advance the offset to the next co...">U8_NEXT_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002928">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00344">344</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7dda2b78867c9d648ad5a0f400fdb1b4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_NEXT_OR_FFFD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(uint8_t)(s)[(i)++]; \</div><div class="line">    if((c)&gt;=0x80) { \</div><div class="line">        uint8_t __t1, __t2; \</div><div class="line">        if( <span class="comment">/* handle U+1000..U+CFFF inline */</span> \</div><div class="line">            (0xe0&lt;(c) &amp;&amp; (c)&lt;=0xec) &amp;&amp; \</div><div class="line">            (((i)+1)&lt;(length) || (length)&lt;0) &amp;&amp; \</div><div class="line">            (__t1=(uint8_t)((s)[i]-0x80))&lt;=0x3f &amp;&amp; \</div><div class="line">            (__t2=(uint8_t)((s)[(i)+1]-0x80))&lt;= 0x3f \</div><div class="line">        ) { \</div><div class="line">            <span class="comment">/* no need for (c&amp;0xf) because the upper bits are truncated after &lt;&lt;12 in the cast to (UChar) */</span> \</div><div class="line">            (c)=(<a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((c)&lt;&lt;12)|(__t1&lt;&lt;6)|__t2); \</div><div class="line">            (i)+=2; \</div><div class="line">        } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( <span class="comment">/* handle U+0080..U+07FF inline */</span> \</div><div class="line">            ((c)&lt;0xe0 &amp;&amp; (c)&gt;=0xc2) &amp;&amp; \</div><div class="line">            ((i)!=(length)) &amp;&amp; \</div><div class="line">            (__t1=(uint8_t)((s)[i]-0x80))&lt;=0x3f \</div><div class="line">        ) { \</div><div class="line">            (c)=(((c)&amp;0x1f)&lt;&lt;6)|__t1; \</div><div class="line">            ++(i); \</div><div class="line">        } <span class="keywordflow">else</span> { \</div><div class="line">            <span class="comment">/* function call for &quot;complicated&quot; and error cases */</span> \</div><div class="line">            (c)=<a class="code" href="utf8_8h.html#a6eaf56eb54abb71eafcc0c347daa821f">utf8_nextCharSafeBody</a>((<span class="keyword">const</span> uint8_t *)s, &amp;(i), (length), c, -3); \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a6eaf56eb54abb71eafcc0c347daa821f"><div class="ttname"><a href="utf8_8h.html#a6eaf56eb54abb71eafcc0c347daa821f">utf8_nextCharSafeBody</a></div><div class="ttdeci">UChar32 utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar32 c, UBool strict)</div><div class="ttdoc">Function for handling &quot;next code point&quot; with error-checking. </div></div>
<div class="ttc" id="umachine_8h_html_a6bb9fad572d65b305324ef288165e2ac"><div class="ttname"><a href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a></div><div class="ttdeci">uint16_t UChar</div><div class="ttdoc">Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...</div><div class="ttdef"><b>Definition:</b> <a href="umachine_8h_source.html#l00337">umachine.h:337</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary. </p>
<p>(Post-incrementing forward iteration.) "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<p>The offset may point to the lead byte of a multi-byte sequence, in which case the macro will read the whole sequence. If the offset points to a trail byte or an illegal UTF-8 sequence, then c is set to U+FFFD.</p>
<p>This macro does not distinguish between a real U+FFFD in the text and U+FFFD returned for an ill-formed sequence. Use <a class="el" href="utf8_8h.html#a57f3e5429ae4edb27a42367c627aa482" title="Get a code point from a string at a code point boundary offset, and advance the offset to the next co...">U8_NEXT()</a> if that distinction is important.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable, set to U+FFFD in case of an error </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a57f3e5429ae4edb27a42367c627aa482" title="Get a code point from a string at a code point boundary offset, and advance the offset to the next co...">U8_NEXT</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002929">Stable:</a></b></dt><dd>ICU 51 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00395">395</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a28ecdb4233301285fc4ce7f9ea1ed644"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_NEXT_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(uint8_t)(s)[(i)++]; \</div><div class="line">    if((c)&gt;=0x80) { \</div><div class="line">        if((c)&lt;0xe0) { \</div><div class="line">            (c)=(((c)&amp;0x1f)&lt;&lt;6)|((s)[(i)++]&amp;0x3f); \</div><div class="line">        } <span class="keywordflow">else</span> <span class="keywordflow">if</span>((c)&lt;0xf0) { \</div><div class="line">            <span class="comment">/* no need for (c&amp;0xf) because the upper bits are truncated after &lt;&lt;12 in the cast to (UChar) */</span> \</div><div class="line">            (c)=(<a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((c)&lt;&lt;12)|(((s)[i]&amp;0x3f)&lt;&lt;6)|((s)[(i)+1]&amp;0x3f)); \</div><div class="line">            (i)+=2; \</div><div class="line">        } <span class="keywordflow">else</span> { \</div><div class="line">            (c)=(((c)&amp;7)&lt;&lt;18)|(((s)[i]&amp;0x3f)&lt;&lt;12)|(((s)[(i)+1]&amp;0x3f)&lt;&lt;6)|((s)[(i)+2]&amp;0x3f); \</div><div class="line">            (i)+=3; \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="umachine_8h_html_a6bb9fad572d65b305324ef288165e2ac"><div class="ttname"><a href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a></div><div class="ttdeci">uint16_t UChar</div><div class="ttdoc">Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...</div><div class="ttdef"><b>Definition:</b> <a href="umachine_8h_source.html#l00337">umachine.h:337</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary. </p>
<p>(Post-incrementing forward iteration.) "Unsafe" macro, assumes well-formed UTF-8.</p>
<p>The offset may point to the lead byte of a multi-byte sequence, in which case the macro will read the whole sequence. The result is undefined if the offset points to a trail byte or an illegal UTF-8 sequence.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a57f3e5429ae4edb27a42367c627aa482" title="Get a code point from a string at a code point boundary offset, and advance the offset to the next co...">U8_NEXT</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002927">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00308">308</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a17287c1f01ce84fdf8852a756643b076"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_PREV</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(uint8_t)(s)[--(i)]; \</div><div class="line">    if((c)&gt;=0x80) { \</div><div class="line">        (c)=<a class="code" href="utf8_8h.html#a2bbae41d2d845750088a17dc55f59096">utf8_prevCharSafeBody</a>((<span class="keyword">const</span> uint8_t *)s, start, &amp;(i), c, -1); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a2bbae41d2d845750088a17dc55f59096"><div class="ttname"><a href="utf8_8h.html#a2bbae41d2d845750088a17dc55f59096">utf8_prevCharSafeBody</a></div><div class="ttdeci">UChar32 utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict)</div><div class="ttdoc">Function for handling &quot;previous code point&quot; with error-checking. </div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one and get the code point between them. </p>
<p>(Pre-decrementing backward iteration.) "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<p>The input offset may be the same as the string length. If the offset is behind a multi-byte sequence, then the macro will read the whole sequence. If the offset is behind a lead byte, then that itself will be returned as the code point. If the offset is behind an illegal UTF-8 sequence, then c is set to a negative value.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be start&lt;i </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable, set to &lt;0 in case of an error </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a5f78eb19a6b25f61dccbae45d6ecf955" title="Move the string offset from one code point boundary to the previous one and get the code point betwee...">U8_PREV_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002939">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00670">670</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="aeef5d89106e5cf1c48727100c0b315bd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_PREV_OR_FFFD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(uint8_t)(s)[--(i)]; \</div><div class="line">    if((c)&gt;=0x80) { \</div><div class="line">        (c)=<a class="code" href="utf8_8h.html#a2bbae41d2d845750088a17dc55f59096">utf8_prevCharSafeBody</a>((<span class="keyword">const</span> uint8_t *)s, start, &amp;(i), c, -3); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a2bbae41d2d845750088a17dc55f59096"><div class="ttname"><a href="utf8_8h.html#a2bbae41d2d845750088a17dc55f59096">utf8_prevCharSafeBody</a></div><div class="ttdeci">UChar32 utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict)</div><div class="ttdoc">Function for handling &quot;previous code point&quot; with error-checking. </div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one and get the code point between them. </p>
<p>(Pre-decrementing backward iteration.) "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<p>The input offset may be the same as the string length. If the offset is behind a multi-byte sequence, then the macro will read the whole sequence. If the offset is behind a lead byte, then that itself will be returned as the code point. If the offset is behind an illegal UTF-8 sequence, then c is set to U+FFFD.</p>
<p>This macro does not distinguish between a real U+FFFD in the text and U+FFFD returned for an ill-formed sequence. Use <a class="el" href="utf8_8h.html#a17287c1f01ce84fdf8852a756643b076" title="Move the string offset from one code point boundary to the previous one and get the code point betwee...">U8_PREV()</a> if that distinction is important.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be start&lt;i </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable, set to U+FFFD in case of an error </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a17287c1f01ce84fdf8852a756643b076" title="Move the string offset from one code point boundary to the previous one and get the code point betwee...">U8_PREV</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002940">Stable:</a></b></dt><dd>ICU 51 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00701">701</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5f78eb19a6b25f61dccbae45d6ecf955"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_PREV_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(uint8_t)(s)[--(i)]; \</div><div class="line">    if(<a class="code" href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a>(c)) { \</div><div class="line">        uint8_t __b, __count=1, __shift=6; \</div><div class="line">\</div><div class="line">        <span class="comment">/* c is a trail byte */</span> \</div><div class="line">        (c)&amp;=0x3f; \</div><div class="line">        for(;;) { \</div><div class="line">            __b=(uint8_t)(s)[--(i)]; \</div><div class="line">            if(__b&gt;=0xc0) { <a class="code" href="utf8_8h.html#ae8ed1045986b8bf27814e9bc78388961">\</a></div><div class="line"><a class="code" href="utf8_8h.html#ae8ed1045986b8bf27814e9bc78388961">                U8_MASK_LEAD_BYTE</a>(__b, __count); \</div><div class="line">                (c)|=(<a class="code" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>)__b&lt;&lt;__shift; \</div><div class="line">                break; \</div><div class="line">            } <span class="keywordflow">else</span> { \</div><div class="line">                (c)|=(<a class="code" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>)(__b&amp;0x3f)&lt;&lt;__shift; \</div><div class="line">                ++__count; \</div><div class="line">                __shift+=6; \</div><div class="line">            } \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_ae8ed1045986b8bf27814e9bc78388961"><div class="ttname"><a href="utf8_8h.html#ae8ed1045986b8bf27814e9bc78388961">U8_MASK_LEAD_BYTE</a></div><div class="ttdeci">#define U8_MASK_LEAD_BYTE(leadByte, countTrailBytes)</div><div class="ttdoc">Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value...</div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00108">utf8.h:108</a></div></div>
<div class="ttc" id="utf8_8h_html_afed9fc9bf480bf15a2e6051774f2d80e"><div class="ttname"><a href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a></div><div class="ttdeci">#define U8_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit (byte) a UTF-8 trail byte? </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00182">utf8.h:182</a></div></div>
<div class="ttc" id="umachine_8h_html_a09fff5c3b5a5b015324dc3ec3cf92809"><div class="ttname"><a href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a></div><div class="ttdeci">int32_t UChar32</div><div class="ttdoc">Define UChar32 as a type for single Unicode code points. </div><div class="ttdef"><b>Definition:</b> <a href="umachine_8h_source.html#l00357">umachine.h:357</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one and get the code point between them. </p>
<p>(Pre-decrementing backward iteration.) "Unsafe" macro, assumes well-formed UTF-8.</p>
<p>The input offset may be the same as the string length. If the offset is behind a multi-byte sequence, then the macro will read the whole sequence. If the offset is behind a lead byte, then that itself will be returned as the code point. The result is undefined if the offset is behind an illegal UTF-8 sequence.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a17287c1f01ce84fdf8852a756643b076" title="Move the string offset from one code point boundary to the previous one and get the code point betwee...">U8_PREV</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002938">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00628">628</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a40fe523809a3a4e647e47513336b81d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_SET_CP_LIMIT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if((start)&lt;(i) &amp;&amp; ((i)&lt;(length) || (length)&lt;0)) { <a class="code" href="utf8_8h.html#adac4ee359e6233cb2990b1047fd5be3c">\</a></div><div class="line"><a class="code" href="utf8_8h.html#adac4ee359e6233cb2990b1047fd5be3c">        U8_BACK_1</a>(s, start, i); <a class="code" href="utf8_8h.html#a6d4c94e845b059fddba0c51e9bad87fd">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a6d4c94e845b059fddba0c51e9bad87fd">        U8_FWD_1</a>(s, i, length); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_adac4ee359e6233cb2990b1047fd5be3c"><div class="ttname"><a href="utf8_8h.html#adac4ee359e6233cb2990b1047fd5be3c">U8_BACK_1</a></div><div class="ttdeci">#define U8_BACK_1(s, start, i)</div><div class="ttdoc">Move the string offset from one code point boundary to the previous one. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00735">utf8.h:735</a></div></div>
<div class="ttc" id="utf8_8h_html_a6d4c94e845b059fddba0c51e9bad87fd"><div class="ttname"><a href="utf8_8h.html#a6d4c94e845b059fddba0c51e9bad87fd">U8_FWD_1</a></div><div class="ttdeci">#define U8_FWD_1(s, i, length)</div><div class="ttdoc">Advance the string offset from one code point boundary to the next. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00513">utf8.h:513</a></div></div>
</div><!-- fragment -->
<p>Adjust a random-access offset to a code point boundary after a code point. </p>
<p>If the offset is behind a partial multi-byte sequence, then the offset is incremented to behind the whole sequence. Otherwise, it is not modified. The input offset may be the same as the string length. "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be start&lt;=i&lt;=length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a910ba47de6d82fafc25b5e12f3a68588" title="Adjust a random-access offset to a code point boundary after a code point. ">U8_SET_CP_LIMIT_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002946">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00819">819</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="a910ba47de6d82fafc25b5e12f3a68588"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_SET_CP_LIMIT_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ <a class="code" href="utf8_8h.html#a3969beb6252f8605ab678990c8af2f48">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a3969beb6252f8605ab678990c8af2f48">    U8_BACK_1_UNSAFE</a>(s, i); <a class="code" href="utf8_8h.html#a64a8113aea2125f806cbf5d77294b3cd">\</a></div><div class="line"><a class="code" href="utf8_8h.html#a64a8113aea2125f806cbf5d77294b3cd">    U8_FWD_1_UNSAFE</a>(s, i); \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_a64a8113aea2125f806cbf5d77294b3cd"><div class="ttname"><a href="utf8_8h.html#a64a8113aea2125f806cbf5d77294b3cd">U8_FWD_1_UNSAFE</a></div><div class="ttdeci">#define U8_FWD_1_UNSAFE(s, i)</div><div class="ttdoc">Advance the string offset from one code point boundary to the next. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00496">utf8.h:496</a></div></div>
<div class="ttc" id="utf8_8h_html_a3969beb6252f8605ab678990c8af2f48"><div class="ttname"><a href="utf8_8h.html#a3969beb6252f8605ab678990c8af2f48">U8_BACK_1_UNSAFE</a></div><div class="ttdeci">#define U8_BACK_1_UNSAFE(s, i)</div><div class="ttdoc">Move the string offset from one code point boundary to the previous one. </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00719">utf8.h:719</a></div></div>
</div><!-- fragment -->
<p>Adjust a random-access offset to a code point boundary after a code point. </p>
<p>If the offset is behind a partial multi-byte sequence, then the offset is incremented to behind the whole sequence. Otherwise, it is not modified. The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-8.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#a40fe523809a3a4e647e47513336b81d9" title="Adjust a random-access offset to a code point boundary after a code point. ">U8_SET_CP_LIMIT</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002945">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00797">797</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa6d33627a8a5420a8f61e50da2aeca2a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_SET_CP_START</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a>((s)[(i)])) { \</div><div class="line">        (i)=<a class="code" href="utf8_8h.html#a4017310e2ecadac7dea5a432a33ccf30">utf8_back1SafeBody</a>(s, start, (i)); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_afed9fc9bf480bf15a2e6051774f2d80e"><div class="ttname"><a href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a></div><div class="ttdeci">#define U8_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit (byte) a UTF-8 trail byte? </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00182">utf8.h:182</a></div></div>
<div class="ttc" id="utf8_8h_html_a4017310e2ecadac7dea5a432a33ccf30"><div class="ttname"><a href="utf8_8h.html#a4017310e2ecadac7dea5a432a33ccf30">utf8_back1SafeBody</a></div><div class="ttdeci">int32_t utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i)</div><div class="ttdoc">Function for handling &quot;skip backward one code point&quot; with error-checking. </div></div>
</div><!-- fragment -->
<p>Adjust a random-access offset to a code point boundary at the start of a code point. </p>
<p>If the offset points to a UTF-8 trail byte, then the offset is moved backward to the corresponding lead byte. Otherwise, it is not modified. "Safe" macro, checks for illegal sequences and for string boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be start&lt;=i </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#ac46a385dbf64c97337522e1d1875a57e" title="Adjust a random-access offset to a code point boundary at the start of a code point. ">U8_SET_CP_START_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002937">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00601">601</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<a class="anchor" id="ac46a385dbf64c97337522e1d1875a57e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U8_SET_CP_START_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    while(<a class="code" href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a>((s)[i])) { --(i); } \</div><div class="line">}</div><div class="ttc" id="utf8_8h_html_afed9fc9bf480bf15a2e6051774f2d80e"><div class="ttname"><a href="utf8_8h.html#afed9fc9bf480bf15a2e6051774f2d80e">U8_IS_TRAIL</a></div><div class="ttdeci">#define U8_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit (byte) a UTF-8 trail byte? </div><div class="ttdef"><b>Definition:</b> <a href="utf8_8h_source.html#l00182">utf8.h:182</a></div></div>
</div><!-- fragment -->
<p>Adjust a random-access offset to a code point boundary at the start of a code point. </p>
<p>If the offset points to a UTF-8 trail byte, then the offset is moved backward to the corresponding lead byte. Otherwise, it is not modified. "Unsafe" macro, assumes well-formed UTF-8.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const uint8_t * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf8_8h.html#aa6d33627a8a5420a8f61e50da2aeca2a" title="Adjust a random-access offset to a code point boundary at the start of a code point. ">U8_SET_CP_START</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002936">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00583">583</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6cf17491f1c237bbe5b002056b830fd3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t utf8_appendCharSafeBody </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> *&#160;</td>
          <td class="paramname"><em>pIsError</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for handling "append code point" with error-checking. </p>
<p>This is internal since it is not meant to be called directly by external clients; however it is U_STABLE (not U_INTERNAL) since it is called by public macros in this file and thus must remain stable, and should not be hidden when other internal functions are hidden (otherwise public macros would fail to compile). </p><dl class="internal"><dt><b><a class="el" href="internal.html#_internal000216">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

</div>
</div>
<a class="anchor" id="a4017310e2ecadac7dea5a432a33ccf30"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t utf8_back1SafeBody </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>i</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for handling "skip backward one code point" with error-checking. </p>
<p>This is internal since it is not meant to be called directly by external clients; however it is U_STABLE (not U_INTERNAL) since it is called by public macros in this file and thus must remain stable, and should not be hidden when other internal functions are hidden (otherwise public macros would fail to compile). </p><dl class="internal"><dt><b><a class="el" href="internal.html#_internal000218">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

</div>
</div>
<a class="anchor" id="a6eaf56eb54abb71eafcc0c347daa821f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a> utf8_nextCharSafeBody </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t *&#160;</td>
          <td class="paramname"><em>pi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a>&#160;</td>
          <td class="paramname"><em>strict</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for handling "next code point" with error-checking. </p>
<p>This is internal since it is not meant to be called directly by external clients; however it is U_STABLE (not U_INTERNAL) since it is called by public macros in this file and thus must remain stable, and should not be hidden when other internal functions are hidden (otherwise public macros would fail to compile). </p><dl class="internal"><dt><b><a class="el" href="internal.html#_internal000215">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

</div>
</div>
<a class="anchor" id="a2bbae41d2d845750088a17dc55f59096"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a> utf8_prevCharSafeBody </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t *&#160;</td>
          <td class="paramname"><em>pi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a>&#160;</td>
          <td class="paramname"><em>strict</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for handling "previous code point" with error-checking. </p>
<p>This is internal since it is not meant to be called directly by external clients; however it is U_STABLE (not U_INTERNAL) since it is called by public macros in this file and thus must remain stable, and should not be hidden when other internal functions are hidden (otherwise public macros would fail to compile). </p><dl class="internal"><dt><b><a class="el" href="internal.html#_internal000217">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="a4e3ae25d5856272ab60ab87c28572a99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">utf8_countTrailBytes</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Internal array with numbers of trail bytes for any given byte used in lead byte position. </p>
<p>This is internal since it is not meant to be called directly by external clients; however it is called by public macros in this file and thus must remain stable, and should not be hidden when other internal functions are hidden (otherwise public macros would fail to compile). </p><dl class="internal"><dt><b><a class="el" href="internal.html#_internal000211">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

<p>Definition at line <a class="el" href="utf8_8h_source.html#l00062">62</a> of file <a class="el" href="utf8_8h_source.html">utf8.h</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>