Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 34ae14235711d1471f043ac894a061f9 > files > 471

libicu-doc-3.6-5.16.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ICU 3.6: utf16.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>Globals</span></a></li>
  </ul></div>
<h1>utf16.h File Reference</h1>C API: 16-bit Unicode handling macros. <a href="#_details">More...</a>
<p>
<code>#include &quot;<a class="el" href="utf_8h-source.html">unicode/utf.h</a>&quot;</code><br>

<p>
<a href="utf16_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#362166cce303677d00efda56f88fe2d6">U16_IS_SINGLE</a>(c)&nbsp;&nbsp;&nbsp;!U_IS_SURROGATE(c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Does this code unit alone encode a code point (BMP, not a surrogate)?  <a href="#362166cce303677d00efda56f88fe2d6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>(c)&nbsp;&nbsp;&nbsp;(((c)&amp;0xfffffc00)==0xd800)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is this code unit a lead surrogate (U+d800.  <a href="#d7693c2144d426edee64b2b0de5bbfa8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>(c)&nbsp;&nbsp;&nbsp;(((c)&amp;0xfffffc00)==0xdc00)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is this code unit a trail surrogate (U+dc00.  <a href="#3363c3d650a6161795ed44c2b553e37d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#b196de43bd882d206b8d21e99865c9d8">U16_IS_SURROGATE</a>(c)&nbsp;&nbsp;&nbsp;U_IS_SURROGATE(c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is this code unit a surrogate (U+d800.  <a href="#b196de43bd882d206b8d21e99865c9d8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a323683efe631166191d5734342e4fad">U16_IS_SURROGATE_LEAD</a>(c)&nbsp;&nbsp;&nbsp;(((c)&amp;0x400)==0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assuming c is a surrogate code point (<a class="el" href="utf16_8h.html#b196de43bd882d206b8d21e99865c9d8">U16_IS_SURROGATE(c)</a>), is it a lead surrogate?  <a href="#a323683efe631166191d5734342e4fad"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#112d75dd554993f9579b0db50bfc0eed">U16_SURROGATE_OFFSET</a>&nbsp;&nbsp;&nbsp;((0xd800&lt;&lt;10UL)+0xdc00-0x10000)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Helper constant for U16_GET_SUPPLEMENTARY.  <a href="#112d75dd554993f9579b0db50bfc0eed"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>(lead, trail)&nbsp;&nbsp;&nbsp;(((<a class="el" href="umachine_8h.html#a5c18ea10e60c576fe5ec420a7ef7b28">UChar32</a>)(lead)&lt;&lt;10UL)+(UChar32)(trail)-U16_SURROGATE_OFFSET)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a supplementary code point value (U+10000.  <a href="#cbfc54a95d041a068e9a6f34bfa939ef"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#8773cfcf6f3a54114a7b34bc185fae34">U16_LEAD</a>(supplementary)&nbsp;&nbsp;&nbsp;(UChar)(((supplementary)&gt;&gt;10)+0xd7c0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the lead surrogate (0xd800.  <a href="#8773cfcf6f3a54114a7b34bc185fae34"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#25a4c7a3fc918966024ec53322a08a2c">U16_TRAIL</a>(supplementary)&nbsp;&nbsp;&nbsp;(UChar)(((supplementary)&amp;0x3ff)|0xdc00)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the trail surrogate (0xdc00.  <a href="#25a4c7a3fc918966024ec53322a08a2c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#7f3b3f3ab7a096709b09904948c31be3">U16_LENGTH</a>(c)&nbsp;&nbsp;&nbsp;((<a class="el" href="pwin32_8h.html#6dffdaa3be697bee6b7286a8120d3638">uint32_t</a>)(c)&lt;=0xffff ? 1 : 2)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">How many 16-bit code units are used to encode this Unicode code point? (1 or 2) The result is not defined if c is not a Unicode code point (U+0000.  <a href="#7f3b3f3ab7a096709b09904948c31be3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#132364039b672f95180c27693ee20028">U16_MAX_LENGTH</a>&nbsp;&nbsp;&nbsp;2</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum number of 16-bit code units per Unicode code point (U+0000.  <a href="#132364039b672f95180c27693ee20028"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#800101a422d488ff8e2d13c9e0a7eb4a">U16_GET_UNSAFE</a>(s, i, c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a code point from a string at a random-access offset, without changing the offset.  <a href="#800101a422d488ff8e2d13c9e0a7eb4a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#15d0f767b0a5c8c92816e914cce8e490">U16_GET</a>(s, start, i, <a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>, c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a code point from a string at a random-access offset, without changing the offset.  <a href="#15d0f767b0a5c8c92816e914cce8e490"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#0186db357027cee928da04b3b9b3c05e">U16_NEXT_UNSAFE</a>(s, i, c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#0186db357027cee928da04b3b9b3c05e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#1a6e1c638ac5ba466d13fa83949b740b">U16_NEXT</a>(s, i, <a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>, c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#1a6e1c638ac5ba466d13fa83949b740b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#8b2d32badc574394c243426b67ccdd2f">U16_APPEND_UNSAFE</a>(s, i, c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Append a code point to a string, overwriting 1 or 2 code units.  <a href="#8b2d32badc574394c243426b67ccdd2f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#239978eefdde632dd16502a7a47d26ca">U16_APPEND</a>(s, i, capacity, c, isError)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Append a code point to a string, overwriting 1 or 2 code units.  <a href="#239978eefdde632dd16502a7a47d26ca"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#45792331972f54e0c5c354ab81a90068">U16_FWD_1_UNSAFE</a>(s, i)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Advance the string offset from one code point boundary to the next.  <a href="#45792331972f54e0c5c354ab81a90068"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ca0e26ad4d8cbc5f41d550404e7dc9e3">U16_FWD_1</a>(s, i, <a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Advance the string offset from one code point boundary to the next.  <a href="#ca0e26ad4d8cbc5f41d550404e7dc9e3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#5f1ee28d914ab43c9df8b0679179aadf">U16_FWD_N_UNSAFE</a>(s, i, n)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#5f1ee28d914ab43c9df8b0679179aadf"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#1f638c7f80ced61bed18d1041d30719d">U16_FWD_N</a>(s, i, <a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>, n)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#1f638c7f80ced61bed18d1041d30719d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#8315c55d7478274b81577a259c255401">U16_SET_CP_START_UNSAFE</a>(s, i)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary at the start of a code point.  <a href="#8315c55d7478274b81577a259c255401"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#7552e91e1127a6c68c16adffd07ba6a7">U16_SET_CP_START</a>(s, start, i)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary at the start of a code point.  <a href="#7552e91e1127a6c68c16adffd07ba6a7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#8b371ab218a1cc9bc6b6c774ca47a732">U16_PREV_UNSAFE</a>(s, i, c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#8b371ab218a1cc9bc6b6c774ca47a732"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#149931004c5140c0a8655f891c99d894">U16_PREV</a>(s, start, i, c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#149931004c5140c0a8655f891c99d894"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#444c1cbc24c5815c41678909fd360943">U16_BACK_1_UNSAFE</a>(s, i)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one.  <a href="#444c1cbc24c5815c41678909fd360943"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#5936c0b44368fc808232b59c1de42c5c">U16_BACK_1</a>(s, start, i)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one.  <a href="#5936c0b44368fc808232b59c1de42c5c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ae0942df6d87fb437f2ef6d344a77e87">U16_BACK_N_UNSAFE</a>(s, i, n)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#ae0942df6d87fb437f2ef6d344a77e87"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#6865317f8558a69731dde4e3d7931c24">U16_BACK_N</a>(s, start, i, n)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#6865317f8558a69731dde4e3d7931c24"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#b58a26591ec542fbc52c7b2ed1551033">U16_SET_CP_LIMIT_UNSAFE</a>(s, i)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary after a code point.  <a href="#b58a26591ec542fbc52c7b2ed1551033"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#6f802103e73577b00fa849785e2af39d">U16_SET_CP_LIMIT</a>(s, start, i, <a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary after a code point.  <a href="#6f802103e73577b00fa849785e2af39d"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
C API: 16-bit Unicode handling macros. 
<p>
This file defines macros to deal with 16-bit Unicode (UTF-16) code units and strings. <a class="el" href="utf16_8h.html">utf16.h</a> is included by <a class="el" href="utf_8h.html">utf.h</a> after <a class="el" href="umachine_8h.html">unicode/umachine.h</a> and some common definitions.<p>
For more information see <a class="el" href="utf_8h.html">utf.h</a> and the ICU User Guide Strings chapter (<a href="http://icu.sourceforge.net/userguide/strings.html">http://icu.sourceforge.net/userguide/strings.html</a>).<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>
Definition in file <a class="el" href="utf16_8h-source.html">utf16.h</a>.<hr><h2>Define Documentation</h2>
<a class="anchor" name="239978eefdde632dd16502a7a47d26ca"></a><!-- doxytag: member="utf16.h::U16_APPEND" ref="239978eefdde632dd16502a7a47d26ca" args="(s, i, capacity, c, isError)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_APPEND          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">capacity,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">isError&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>((<a class="code" href="pwin32_8h.html#6dffdaa3be697bee6b7286a8120d3638">uint32_t</a>)(c)&lt;=0xffff) { \
        (s)[(i)++]=(<a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a>)(c); \
    } <span class="keywordflow">else</span> <span class="keywordflow">if</span>((<a class="code" href="pwin32_8h.html#6dffdaa3be697bee6b7286a8120d3638">uint32_t</a>)(c)&lt;=0x10ffff &amp;&amp; (i)+1&lt;(capacity)) { \
        (s)[(i)++]=(<a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a>)(((c)&gt;&gt;10)+0xd7c0); \
        (s)[(i)++]=(<a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a>)(((c)&amp;0x3ff)|0xdc00); \
    } <span class="keywordflow">else</span> <span class="comment">/* c&gt;0x10ffff or not enough space */</span> { \
        (isError)=<a class="code" href="umachine_8h.html#528a67cfb212764fdec08c7c065a04f8">TRUE</a>; \
    } \
}
</pre></div>Append a code point to a string, overwriting 1 or 2 code units. 
<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 surrogate pair is written, checks for sufficient space in the string. If the code point is not valid or a trail surrogate does not fit, then isError is set to TRUE.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string buffer </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be i&lt;capacity </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>capacity</em>&nbsp;</td><td>size of the string buffer </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>code point to append </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>isError</em>&nbsp;</td><td>output UBool set to TRUE if an error occurs, otherwise not modified </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#8b2d32badc574394c243426b67ccdd2f">U16_APPEND_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001700">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00302">302</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
<p>
Referenced by <a class="el" href="unistr_8h-source.html#l04009">UnicodeString::append()</a>, and <a class="el" href="unistr_8h-source.html#l03771">UnicodeString::replace()</a>.
</div>
</div><p>
<a class="anchor" name="8b2d32badc574394c243426b67ccdd2f"></a><!-- doxytag: member="utf16.h::U16_APPEND_UNSAFE" ref="8b2d32badc574394c243426b67ccdd2f" args="(s, i, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_APPEND_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>((<a class="code" href="pwin32_8h.html#6dffdaa3be697bee6b7286a8120d3638">uint32_t</a>)(c)&lt;=0xffff) { \
        (s)[(i)++]=(<a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a>)(c); \
    } <span class="keywordflow">else</span> { \
        (s)[(i)++]=(<a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a>)(((c)&gt;&gt;10)+0xd7c0); \
        (s)[(i)++]=(<a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a>)(((c)&amp;0x3ff)|0xdc00); \
    } \
}
</pre></div>Append a code point to a string, overwriting 1 or 2 code units. 
<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 compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string buffer </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>code point to append </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#239978eefdde632dd16502a7a47d26ca">U16_APPEND</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001699">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00276">276</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="5936c0b44368fc808232b59c1de42c5c"></a><!-- doxytag: member="utf16.h::U16_BACK_1" ref="5936c0b44368fc808232b59c1de42c5c" args="(s, start, i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_BACK_1          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>((s)[--(i)]) &amp;&amp; (i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>((s)[(i)-1])) { \
        --(i); \
    } \
}
</pre></div>Move the string offset from one code point boundary to the previous one. 
<p>
(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>start</em>&nbsp;</td><td>starting string offset (usually 0) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be start&lt;i </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#444c1cbc24c5815c41678909fd360943">U16_BACK_1_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001710">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00516">516</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="444c1cbc24c5815c41678909fd360943"></a><!-- doxytag: member="utf16.h::U16_BACK_1_UNSAFE" ref="444c1cbc24c5815c41678909fd360943" args="(s, i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_BACK_1_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>((s)[--(i)])) { \
        --(i); \
    } \
}
</pre></div>Move the string offset from one code point boundary to the previous one. 
<p>
(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-16.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#5936c0b44368fc808232b59c1de42c5c">U16_BACK_1</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001709">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00498">498</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="6865317f8558a69731dde4e3d7931c24"></a><!-- doxytag: member="utf16.h::U16_BACK_N" ref="6865317f8558a69731dde4e3d7931c24" args="(s, start, i, n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_BACK_N          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">n&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <a class="code" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> __N=(n); \
    <span class="keywordflow">while</span>(__N&gt;0 &amp;&amp; (i)&gt;(start)) { \
        <a class="code" href="utf16_8h.html#5936c0b44368fc808232b59c1de42c5c">U16_BACK_1</a>(s, start, i); \
        --__N; \
    } \
}
</pre></div>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>
(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>start</em>&nbsp;</td><td>start of string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be start&lt;i </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>number of code points to skip </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#ae0942df6d87fb437f2ef6d344a77e87">U16_BACK_N_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001712">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00557">557</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="ae0942df6d87fb437f2ef6d344a77e87"></a><!-- doxytag: member="utf16.h::U16_BACK_N_UNSAFE" ref="ae0942df6d87fb437f2ef6d344a77e87" args="(s, i, n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_BACK_N_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">n&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <a class="code" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> __N=(n); \
    <span class="keywordflow">while</span>(__N&gt;0) { \
        <a class="code" href="utf16_8h.html#444c1cbc24c5815c41678909fd360943">U16_BACK_1_UNSAFE</a>(s, i); \
        --__N; \
    } \
}
</pre></div>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>
(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-16.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>number of code points to skip </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#6865317f8558a69731dde4e3d7931c24">U16_BACK_N</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001711">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00535">535</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="ca0e26ad4d8cbc5f41d550404e7dc9e3"></a><!-- doxytag: member="utf16.h::U16_FWD_1" ref="ca0e26ad4d8cbc5f41d550404e7dc9e3" args="(s, i, length)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_FWD_1          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>((s)[(i)++]) &amp;&amp; (i)&lt;(<a class="code" href="ucnv_8h.html#c14f4e493302a219114039668cd5c7d1">length</a>) &amp;&amp; <a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>((s)[i])) { \
        ++(i); \
    } \
}
</pre></div>Advance the string offset from one code point boundary to the next. 
<p>
(Post-incrementing iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be i&lt;length </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>string length </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#45792331972f54e0c5c354ab81a90068">U16_FWD_1_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001702">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00340">340</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="45792331972f54e0c5c354ab81a90068"></a><!-- doxytag: member="utf16.h::U16_FWD_1_UNSAFE" ref="45792331972f54e0c5c354ab81a90068" args="(s, i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_FWD_1_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>((s)[(i)++])) { \
        ++(i); \
    } \
}
</pre></div>Advance the string offset from one code point boundary to the next. 
<p>
(Post-incrementing iteration.) "Unsafe" macro, assumes well-formed UTF-16.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#ca0e26ad4d8cbc5f41d550404e7dc9e3">U16_FWD_1</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001701">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00323">323</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="1f638c7f80ced61bed18d1041d30719d"></a><!-- doxytag: member="utf16.h::U16_FWD_N" ref="1f638c7f80ced61bed18d1041d30719d" args="(s, i, length, n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_FWD_N          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">n&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <a class="code" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> __N=(n); \
    <span class="keywordflow">while</span>(__N&gt;0 &amp;&amp; (i)&lt;(<a class="code" href="ucnv_8h.html#c14f4e493302a219114039668cd5c7d1">length</a>)) { \
        <a class="code" href="utf16_8h.html#ca0e26ad4d8cbc5f41d550404e7dc9e3">U16_FWD_1</a>(s, i, <a class="code" href="ucnv_8h.html#c14f4e493302a219114039668cd5c7d1">length</a>); \
        --__N; \
    } \
}
</pre></div>Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. 
<p>
(Post-incrementing iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be i&lt;length </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>string length </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>number of code points to skip </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#5f1ee28d914ab43c9df8b0679179aadf">U16_FWD_N_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001704">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00379">379</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="5f1ee28d914ab43c9df8b0679179aadf"></a><!-- doxytag: member="utf16.h::U16_FWD_N_UNSAFE" ref="5f1ee28d914ab43c9df8b0679179aadf" args="(s, i, n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_FWD_N_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">n&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <a class="code" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> __N=(n); \
    <span class="keywordflow">while</span>(__N&gt;0) { \
        <a class="code" href="utf16_8h.html#45792331972f54e0c5c354ab81a90068">U16_FWD_1_UNSAFE</a>(s, i); \
        --__N; \
    } \
}
</pre></div>Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. 
<p>
(Post-incrementing iteration.) "Unsafe" macro, assumes well-formed UTF-16.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>number of code points to skip </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#1f638c7f80ced61bed18d1041d30719d">U16_FWD_N</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001703">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00358">358</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="15d0f767b0a5c8c92816e914cce8e490"></a><!-- doxytag: member="utf16.h::U16_GET" ref="15d0f767b0a5c8c92816e914cce8e490" args="(s, start, i, length, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_GET          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[i]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#b196de43bd882d206b8d21e99865c9d8">U16_IS_SURROGATE</a>(c)) { \
        <a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a> __c2; \
        <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#a323683efe631166191d5734342e4fad">U16_IS_SURROGATE_LEAD</a>(c)) { \
            <span class="keywordflow">if</span>((i)+1&lt;(<a class="code" href="ucnv_8h.html#c14f4e493302a219114039668cd5c7d1">length</a>) &amp;&amp; <a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>(__c2=(s)[(i)+1])) { \
                (c)=<a class="code" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>((c), __c2); \
            } \
        } <span class="keywordflow">else</span> { \
            <span class="keywordflow">if</span>((i)-1&gt;=(start) &amp;&amp; <a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>(__c2=(s)[(i)-1])) { \
                (c)=<a class="code" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>(__c2, (c)); \
            } \
        } \
    } \
}
</pre></div>Get a code point from a string at a random-access offset, without changing the offset. 
<p>
"Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
The offset may point to either the lead or trail surrogate unit for a supplementary code point, in which case the macro will read the adjacent matching surrogate as well. If the offset points to a single, unpaired surrogate, then that itself will be returned as the code point. Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>start</em>&nbsp;</td><td>starting string offset (usually 0) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be start&lt;=i&lt;length </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>string length </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>output UChar32 variable </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#800101a422d488ff8e2d13c9e0a7eb4a">U16_GET_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001696">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00188">188</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
<p>
Referenced by <a class="el" href="unistr_8h-source.html#l03875">UnicodeString::char32At()</a>.
</div>
</div><p>
<a class="anchor" name="cbfc54a95d041a068e9a6f34bfa939ef"></a><!-- doxytag: member="utf16.h::U16_GET_SUPPLEMENTARY" ref="cbfc54a95d041a068e9a6f34bfa939ef" args="(lead, trail)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_GET_SUPPLEMENTARY          </td>
          <td>(</td>
          <td class="paramtype">lead,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">trail&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;(((<a class="el" href="umachine_8h.html#a5c18ea10e60c576fe5ec420a7ef7b28">UChar32</a>)(lead)&lt;&lt;10UL)+(UChar32)(trail)-U16_SURROGATE_OFFSET)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a supplementary code point value (U+10000. 
<p>
.U+10ffff) from its lead and trail surrogates. The result is undefined if the input values are not lead and trail surrogates.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>lead</em>&nbsp;</td><td>lead surrogate (U+d800..U+dbff) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>trail</em>&nbsp;</td><td>trail surrogate (U+dc00..U+dfff) </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>supplementary code point (U+10000..U+10ffff) </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001690">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00102">102</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="800101a422d488ff8e2d13c9e0a7eb4a"></a><!-- doxytag: member="utf16.h::U16_GET_UNSAFE" ref="800101a422d488ff8e2d13c9e0a7eb4a" args="(s, i, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_GET_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[i]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#b196de43bd882d206b8d21e99865c9d8">U16_IS_SURROGATE</a>(c)) { \
        <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#a323683efe631166191d5734342e4fad">U16_IS_SURROGATE_LEAD</a>(c)) { \
            (c)=<a class="code" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>((c), (s)[(i)+1]); \
        } <span class="keywordflow">else</span> { \
            (c)=<a class="code" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>((s)[(i)-1], (c)); \
        } \
    } \
}
</pre></div>Get a code point from a string at a random-access offset, without changing the offset. 
<p>
"Unsafe" macro, assumes well-formed UTF-16.<p>
The offset may point to either the lead or trail surrogate unit for a supplementary code point, in which case the macro will read the adjacent matching surrogate as well. The result is undefined if the offset points to a single, unpaired surrogate. Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>output UChar32 variable </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#15d0f767b0a5c8c92816e914cce8e490">U16_GET</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001695">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00157">157</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="d7693c2144d426edee64b2b0de5bbfa8"></a><!-- doxytag: member="utf16.h::U16_IS_LEAD" ref="d7693c2144d426edee64b2b0de5bbfa8" args="(c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_LEAD          </td>
          <td>(</td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;(((c)&amp;0xfffffc00)==0xd800)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Is this code unit a lead surrogate (U+d800. 
<p>
.U+dbff)? <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>16-bit code unit </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001686">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00058">58</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="362166cce303677d00efda56f88fe2d6"></a><!-- doxytag: member="utf16.h::U16_IS_SINGLE" ref="362166cce303677d00efda56f88fe2d6" args="(c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_SINGLE          </td>
          <td>(</td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;!U_IS_SURROGATE(c)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Does this code unit alone encode a code point (BMP, not a surrogate)? 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>16-bit code unit </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001685">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00050">50</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="b196de43bd882d206b8d21e99865c9d8"></a><!-- doxytag: member="utf16.h::U16_IS_SURROGATE" ref="b196de43bd882d206b8d21e99865c9d8" args="(c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_SURROGATE          </td>
          <td>(</td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;U_IS_SURROGATE(c)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Is this code unit a surrogate (U+d800. 
<p>
.U+dfff)? <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>16-bit code unit </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001688">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00074">74</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="a323683efe631166191d5734342e4fad"></a><!-- doxytag: member="utf16.h::U16_IS_SURROGATE_LEAD" ref="a323683efe631166191d5734342e4fad" args="(c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_SURROGATE_LEAD          </td>
          <td>(</td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;(((c)&amp;0x400)==0)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Assuming c is a surrogate code point (<a class="el" href="utf16_8h.html#b196de43bd882d206b8d21e99865c9d8">U16_IS_SURROGATE(c)</a>), is it a lead surrogate? 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>16-bit code unit </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001689">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00083">83</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="3363c3d650a6161795ed44c2b553e37d"></a><!-- doxytag: member="utf16.h::U16_IS_TRAIL" ref="3363c3d650a6161795ed44c2b553e37d" args="(c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_TRAIL          </td>
          <td>(</td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;(((c)&amp;0xfffffc00)==0xdc00)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Is this code unit a trail surrogate (U+dc00. 
<p>
.U+dfff)? <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>16-bit code unit </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001687">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00066">66</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="8773cfcf6f3a54114a7b34bc185fae34"></a><!-- doxytag: member="utf16.h::U16_LEAD" ref="8773cfcf6f3a54114a7b34bc185fae34" args="(supplementary)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_LEAD          </td>
          <td>(</td>
          <td class="paramtype">supplementary&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;(UChar)(((supplementary)&gt;&gt;10)+0xd7c0)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the lead surrogate (0xd800. 
<p>
.0xdbff) for a supplementary code point (0x10000..0x10ffff). <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>supplementary</em>&nbsp;</td><td>32-bit code point (U+10000..U+10ffff) </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>lead surrogate (U+d800..U+dbff) for supplementary </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001691">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00113">113</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="7f3b3f3ab7a096709b09904948c31be3"></a><!-- doxytag: member="utf16.h::U16_LENGTH" ref="7f3b3f3ab7a096709b09904948c31be3" args="(c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_LENGTH          </td>
          <td>(</td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;((<a class="el" href="pwin32_8h.html#6dffdaa3be697bee6b7286a8120d3638">uint32_t</a>)(c)&lt;=0xffff ? 1 : 2)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
How many 16-bit code units are used to encode this Unicode code point? (1 or 2) The result is not defined if c is not a Unicode code point (U+0000. 
<p>
.U+10ffff). <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>32-bit code point </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>1 or 2 </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001693">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00131">131</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="132364039b672f95180c27693ee20028"></a><!-- doxytag: member="utf16.h::U16_MAX_LENGTH" ref="132364039b672f95180c27693ee20028" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_MAX_LENGTH&nbsp;&nbsp;&nbsp;2          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The maximum number of 16-bit code units per Unicode code point (U+0000. 
<p>
.U+10ffff). <dl compact><dt><b>Returns:</b></dt><dd>2 </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001694">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00138">138</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
<p>
Referenced by <a class="el" href="unistr_8h-source.html#l04009">UnicodeString::append()</a>, and <a class="el" href="unistr_8h-source.html#l03771">UnicodeString::replace()</a>.
</div>
</div><p>
<a class="anchor" name="1a6e1c638ac5ba466d13fa83949b740b"></a><!-- doxytag: member="utf16.h::U16_NEXT" ref="1a6e1c638ac5ba466d13fa83949b740b" args="(s, i, length, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_NEXT          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[(i)++]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>(c)) { \
        <a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a> __c2; \
        <span class="keywordflow">if</span>((i)&lt;(<a class="code" href="ucnv_8h.html#c14f4e493302a219114039668cd5c7d1">length</a>) &amp;&amp; <a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>(__c2=(s)[(i)])) { \
            ++(i); \
            (c)=<a class="code" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>((c), __c2); \
        } \
    } \
}
</pre></div>Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary. 
<p>
(Post-incrementing forward iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
The offset may point to the lead surrogate unit for a supplementary code point, in which case the macro will read the following trail surrogate as well. If the offset points to a trail surrogate or to a single, unpaired lead surrogate, then that itself will be returned as the code point.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be i&lt;length </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>string length </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>output UChar32 variable </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#0186db357027cee928da04b3b9b3c05e">U16_NEXT_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001698">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00252">252</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="0186db357027cee928da04b3b9b3c05e"></a><!-- doxytag: member="utf16.h::U16_NEXT_UNSAFE" ref="0186db357027cee928da04b3b9b3c05e" args="(s, i, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_NEXT_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[(i)++]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>(c)) { \
        (c)=<a class="code" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>((c), (s)[(i)++]); \
    } \
}
</pre></div>Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary. 
<p>
(Post-incrementing forward iteration.) "Unsafe" macro, assumes well-formed UTF-16.<p>
The offset may point to the lead surrogate unit for a supplementary code point, in which case the macro will read the following trail surrogate as well. If the offset points to a trail surrogate, then that itself will be returned as the code point. The result is undefined if the offset points to a single, unpaired lead surrogate.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>output UChar32 variable </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#1a6e1c638ac5ba466d13fa83949b740b">U16_NEXT</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001697">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00225">225</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="149931004c5140c0a8655f891c99d894"></a><!-- doxytag: member="utf16.h::U16_PREV" ref="149931004c5140c0a8655f891c99d894" args="(s, start, i, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_PREV          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[--(i)]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>(c)) { \
        <a class="code" href="pwin32_8h.html#009defcb88ef0180917f5d2ca68a5c30">uint16_t</a> __c2; \
        <span class="keywordflow">if</span>((i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>(__c2=(s)[(i)-1])) { \
            --(i); \
            (c)=<a class="code" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>(__c2, (c)); \
        } \
    } \
}
</pre></div>Move the string offset from one code point boundary to the previous one and get the code point between them. 
<p>
(Pre-decrementing backward iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
The input offset may be the same as the string length. If the offset is behind a trail surrogate unit for a supplementary code point, then the macro will read the preceding lead surrogate as well. If the offset is behind a lead surrogate or behind a single, unpaired trail surrogate, then that itself will be returned as the code point.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>start</em>&nbsp;</td><td>starting string offset (usually 0) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be start&lt;i </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>output UChar32 variable </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#8b371ab218a1cc9bc6b6c774ca47a732">U16_PREV_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001708">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00476">476</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="8b371ab218a1cc9bc6b6c774ca47a732"></a><!-- doxytag: member="utf16.h::U16_PREV_UNSAFE" ref="8b371ab218a1cc9bc6b6c774ca47a732" args="(s, i, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_PREV_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[--(i)]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>(c)) { \
        (c)=<a class="code" href="utf16_8h.html#cbfc54a95d041a068e9a6f34bfa939ef">U16_GET_SUPPLEMENTARY</a>((s)[--(i)], (c)); \
    } \
}
</pre></div>Move the string offset from one code point boundary to the previous one and get the code point between them. 
<p>
(Pre-decrementing backward iteration.) "Unsafe" macro, assumes well-formed UTF-16.<p>
The input offset may be the same as the string length. If the offset is behind a trail surrogate unit for a supplementary code point, then the macro will read the preceding lead surrogate as well. If the offset is behind a lead surrogate, then that itself will be returned as the code point. The result is undefined if the offset is behind a single, unpaired trail surrogate.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>output UChar32 variable </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#149931004c5140c0a8655f891c99d894">U16_PREV</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001707">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00448">448</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="6f802103e73577b00fa849785e2af39d"></a><!-- doxytag: member="utf16.h::U16_SET_CP_LIMIT" ref="6f802103e73577b00fa849785e2af39d" args="(s, start, i, length)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SET_CP_LIMIT          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ucnv_8h.html#885b7a4b123891f24dedd11fb6b2e641">length</a>&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>((start)&lt;(i) &amp;&amp; (i)&lt;(<a class="code" href="ucnv_8h.html#c14f4e493302a219114039668cd5c7d1">length</a>) &amp;&amp; <a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>((s)[(i)-1]) &amp;&amp; <a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>((s)[i])) { \
        ++(i); \
    } \
}
</pre></div>Adjust a random-access offset to a code point boundary after a code point. 
<p>
If the offset is behind the lead surrogate of a surrogate pair, then the offset is incremented. Otherwise, it is not modified. The input offset may be the same as the string length. "Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>start</em>&nbsp;</td><td>starting string offset (usually 0) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, start&lt;=i&lt;=length </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>string length </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#b58a26591ec542fbc52c7b2ed1551033">U16_SET_CP_LIMIT_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001714">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00599">599</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
<p>
Referenced by <a class="el" href="unistr_8h-source.html#l03897">UnicodeString::getChar32Limit()</a>.
</div>
</div><p>
<a class="anchor" name="b58a26591ec542fbc52c7b2ed1551033"></a><!-- doxytag: member="utf16.h::U16_SET_CP_LIMIT_UNSAFE" ref="b58a26591ec542fbc52c7b2ed1551033" args="(s, i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SET_CP_LIMIT_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>((s)[(i)-1])) { \
        ++(i); \
    } \
}
</pre></div>Adjust a random-access offset to a code point boundary after a code point. 
<p>
If the offset is behind the lead surrogate of a surrogate pair, then the offset is incremented. Otherwise, it is not modified. The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-16.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#6f802103e73577b00fa849785e2af39d">U16_SET_CP_LIMIT</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001713">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00578">578</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="7552e91e1127a6c68c16adffd07ba6a7"></a><!-- doxytag: member="utf16.h::U16_SET_CP_START" ref="7552e91e1127a6c68c16adffd07ba6a7" args="(s, start, i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SET_CP_START          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>((s)[i]) &amp;&amp; (i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#d7693c2144d426edee64b2b0de5bbfa8">U16_IS_LEAD</a>((s)[(i)-1])) { \
        --(i); \
    } \
}
</pre></div>Adjust a random-access offset to a code point boundary at the start of a code point. 
<p>
If the offset points to the trail surrogate of a surrogate pair, then the offset is decremented. Otherwise, it is not modified. "Safe" macro, handles unpaired surrogates and checks for string boundaries.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>start</em>&nbsp;</td><td>starting string offset (usually 0) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset, must be start&lt;=i </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#8315c55d7478274b81577a259c255401">U16_SET_CP_START_UNSAFE</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001706">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00420">420</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
<p>
Referenced by <a class="el" href="unistr_8h-source.html#l03887">UnicodeString::getChar32Start()</a>.
</div>
</div><p>
<a class="anchor" name="8315c55d7478274b81577a259c255401"></a><!-- doxytag: member="utf16.h::U16_SET_CP_START_UNSAFE" ref="8315c55d7478274b81577a259c255401" args="(s, i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SET_CP_START_UNSAFE          </td>
          <td>(</td>
          <td class="paramtype">s,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#3363c3d650a6161795ed44c2b553e37d">U16_IS_TRAIL</a>((s)[i])) { \
        --(i); \
    } \
}
</pre></div>Adjust a random-access offset to a code point boundary at the start of a code point. 
<p>
If the offset points to the trail surrogate of a surrogate pair, then the offset is decremented. Otherwise, it is not modified. "Unsafe" macro, assumes well-formed UTF-16.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>const UChar * string </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>string offset </td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#7552e91e1127a6c68c16adffd07ba6a7">U16_SET_CP_START</a> </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001705">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00400">400</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="112d75dd554993f9579b0db50bfc0eed"></a><!-- doxytag: member="utf16.h::U16_SURROGATE_OFFSET" ref="112d75dd554993f9579b0db50bfc0eed" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SURROGATE_OFFSET&nbsp;&nbsp;&nbsp;((0xd800&lt;&lt;10UL)+0xdc00-0x10000)          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Helper constant for U16_GET_SUPPLEMENTARY. 
<p>
<dl compact><dt><b><a class="el" href="internal.html#_internal000067">Internal:</a></b></dt><dd>Do not use. This API is for interal use only.  </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00089">89</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<a class="anchor" name="25a4c7a3fc918966024ec53322a08a2c"></a><!-- doxytag: member="utf16.h::U16_TRAIL" ref="25a4c7a3fc918966024ec53322a08a2c" args="(supplementary)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_TRAIL          </td>
          <td>(</td>
          <td class="paramtype">supplementary&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;(UChar)(((supplementary)&amp;0x3ff)|0xdc00)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the trail surrogate (0xdc00. 
<p>
.0xdfff) for a supplementary code point (0x10000..0x10ffff). <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>supplementary</em>&nbsp;</td><td>32-bit code point (U+10000..U+10ffff) </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>trail surrogate (U+dc00..U+dfff) for supplementary </dd></dl>
<dl compact><dt><b><a class="el" href="stable.html#_stable001692">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>
Definition at line <a class="el" href="utf16_8h-source.html#l00122">122</a> of file <a class="el" href="utf16_8h-source.html">utf16.h</a>.
</div>
</div><p>
<hr size="1"><address style="align: right;"><small>Generated on Tue Dec 13 17:29:53 2011 for ICU 3.6 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>