Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > f51238514e2abe817779ad2fe01b0759 > files > 785

icu-doc-4.4-2.1mdv2010.2.i586.rpm

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!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"/>
<title>ICU 4.4: utf16.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </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>
</div>
<div class="contents">
<h1>utf16.h File Reference</h1>
<p>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></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a35f04f1f6e7f0965a66b5268eec29b99">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="#a35f04f1f6e7f0965a66b5268eec29b99"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">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..U+dbff)?  <a href="#ace839ae31a801fd9c53fa67c5f8b9144"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">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..U+dfff)?  <a href="#afe8d9f450b9297897f018c2f23eb0724"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea">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..U+dfff)?  <a href="#ac25b589c0c9b60160d357770fad39cea"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a6e141a548138e8c24822d219b7e06cb4">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#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)?">U16_IS_SURROGATE(c)</a>), is it a lead surrogate?  <a href="#a6e141a548138e8c24822d219b7e06cb4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a1da8c1409deafe3ac32a8ab506086c10">U16_IS_SURROGATE_TRAIL</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#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)?">U16_IS_SURROGATE(c)</a>), is it a trail surrogate?  <a href="#a1da8c1409deafe3ac32a8ab506086c10"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a5b15d2eeb271d0a6d92c854681ebaf20">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="#a5b15d2eeb271d0a6d92c854681ebaf20"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>(lead, trail)&nbsp;&nbsp;&nbsp;(((<a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">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..U+10ffff) from its lead and trail surrogates.  <a href="#ac1deffbf1956d9fe696129515e88f006"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ad0e832d06991f5f07a43d68d202165b1">U16_LEAD</a>(supplementary)&nbsp;&nbsp;&nbsp;(<a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((supplementary)&gt;&gt;10)+0xd7c0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the lead surrogate (0xd800..0xdbff) for a supplementary code point (0x10000..0x10ffff).  <a href="#ad0e832d06991f5f07a43d68d202165b1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#abf0698cf645946911b2e10d3ab890321">U16_TRAIL</a>(supplementary)&nbsp;&nbsp;&nbsp;(<a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((supplementary)&amp;0x3ff)|0xdc00)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the trail surrogate (0xdc00..0xdfff) for a supplementary code point (0x10000..0x10ffff).  <a href="#abf0698cf645946911b2e10d3ab890321"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#add0a383d49e1ca81e2920d25883a56a9">U16_LENGTH</a>(c)&nbsp;&nbsp;&nbsp;((uint32_t)(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..U+10ffff).  <a href="#add0a383d49e1ca81e2920d25883a56a9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ab14454ab71a81f0cf86e523e50690eee">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..U+10ffff).  <a href="#ab14454ab71a81f0cf86e523e50690eee"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#af2c94fe2b41f2d73e7600c1ab1ca3b9b">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="#af2c94fe2b41f2d73e7600c1ab1ca3b9b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#aa354b12f5f755fe734f957cde6d68bbe">U16_GET</a>(s, start, i, length, 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="#aa354b12f5f755fe734f957cde6d68bbe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ae98a64ae0f42bc6ad4179293c3638be4">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="#ae98a64ae0f42bc6ad4179293c3638be4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a844bb48486904fdca40c8b883e9c80ee">U16_NEXT</a>(s, i, length, 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="#a844bb48486904fdca40c8b883e9c80ee"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#aea8253343c96066779cd3383080cafa8">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="#aea8253343c96066779cd3383080cafa8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a30e185424986bca1790c1ffe1e2a93b5">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="#a30e185424986bca1790c1ffe1e2a93b5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a148111a5adbb596ad3b6c2e3e3cf7cec">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="#a148111a5adbb596ad3b6c2e3e3cf7cec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a6c79f8f5377e1d4abba0e108be553512">U16_FWD_1</a>(s, i, length)</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="#a6c79f8f5377e1d4abba0e108be553512"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a6632ab346045ebb4fa2d358f19bbd907">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="#a6632ab346045ebb4fa2d358f19bbd907"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ad70d5a679bd03c63131219c7808d9de9">U16_FWD_N</a>(s, i, length, 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="#ad70d5a679bd03c63131219c7808d9de9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ade68651cb87ae4cd94cec2d0036ac9c6">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="#ade68651cb87ae4cd94cec2d0036ac9c6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a31c914801f71204ee90caa6c4d0c3c1b">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="#a31c914801f71204ee90caa6c4d0c3c1b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a4cccc93c8a8e5d438ff6d0371a7a3937">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="#a4cccc93c8a8e5d438ff6d0371a7a3937"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a592fa1f80da119e1c4565dc9193c18d9">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="#a592fa1f80da119e1c4565dc9193c18d9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#aad03daaa2706b094ea7d454d6842f8c4">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="#aad03daaa2706b094ea7d454d6842f8c4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a5f48fd46255969ea3175b3946cf4de80">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="#a5f48fd46255969ea3175b3946cf4de80"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#afa230a7bea98dc8b5b3cd3d936126c6b">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="#afa230a7bea98dc8b5b3cd3d936126c6b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a0a69bdb829f995ad82cb50071f578887">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="#a0a69bdb829f995ad82cb50071f578887"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a4d3e9ee47d4fdb9fbf93a98ee1248c81">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="#a4d3e9ee47d4fdb9fbf93a98ee1248c81"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a3d5ff64af4bf16cbf9a830743a5c74a4">U16_SET_CP_LIMIT</a>(s, start, i, length)</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="#a3d5ff64af4bf16cbf9a830743a5c74a4"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>C API: 16-bit Unicode handling macros. </p>
<p>This file defines macros to deal with 16-bit Unicode (UTF-16) code units and strings. <a class="el" href="utf16_8h.html" title="C API: 16-bit Unicode handling macros.">utf16.h</a> is included by <a class="el" href="utf_8h.html" title="C API: Code point macros.">utf.h</a> after <a class="el" href="umachine_8h.html" title="Basic types and constants for UTF.">unicode/umachine.h</a> and some common definitions.</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://icu-project.org/userguide/strings.html">http://icu-project.org/userguide/strings.html</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="utf16_8h_source.html">utf16.h</a>.</p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a30e185424986bca1790c1ffe1e2a93b5"></a><!-- doxytag: member="utf16.h::U16_APPEND" ref="a30e185424986bca1790c1ffe1e2a93b5" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">capacity, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">isError&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>((uint32_t)(c)&lt;=0xffff) { \
        (s)[(i)++]=(uint16_t)(c); \
    } <span class="keywordflow">else</span> <span class="keywordflow">if</span>((uint32_t)(c)&lt;=0x10ffff &amp;&amp; (i)+1&lt;(capacity)) { \
        (s)[(i)++]=(uint16_t)(((c)&gt;&gt;10)+0xd7c0); \
        (s)[(i)++]=(uint16_t)(((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#aa8cecfc5c5c054d2875c03e77b7be15d" title="The TRUE value of a UBool.">TRUE</a>; \
    } \
}
</pre></div>
<p>Append a code point to a string, overwriting 1 or 2 code units. </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 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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#aea8253343c96066779cd3383080cafa8" title="Append a code point to a string, overwriting 1 or 2 code units.">U16_APPEND_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002039">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00311">311</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

<p>Referenced by <a class="el" href="unistr_8h_source.html#l04323">UnicodeString::append()</a>, and <a class="el" href="unistr_8h_source.html#l04018">UnicodeString::replace()</a>.</p>

</div>
</div>
<a class="anchor" id="aea8253343c96066779cd3383080cafa8"></a><!-- doxytag: member="utf16.h::U16_APPEND_UNSAFE" ref="aea8253343c96066779cd3383080cafa8" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>((uint32_t)(c)&lt;=0xffff) { \
        (s)[(i)++]=(uint16_t)(c); \
    } <span class="keywordflow">else</span> { \
        (s)[(i)++]=(uint16_t)(((c)&gt;&gt;10)+0xd7c0); \
        (s)[(i)++]=(uint16_t)(((c)&amp;0x3ff)|0xdc00); \
    } \
}
</pre></div>
<p>Append a code point to a string, overwriting 1 or 2 code units. </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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a30e185424986bca1790c1ffe1e2a93b5" title="Append a code point to a string, overwriting 1 or 2 code units.">U16_APPEND</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002038">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00285">285</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5f48fd46255969ea3175b3946cf4de80"></a><!-- doxytag: member="utf16.h::U16_BACK_1" ref="a5f48fd46255969ea3175b3946cf4de80" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>((s)[--(i)]) &amp;&amp; (i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>((s)[(i)-1])) { \
        --(i); \
    } \
}
</pre></div>
<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, handles unpaired surrogates and checks for string boundaries.</p>
<dl><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#aad03daaa2706b094ea7d454d6842f8c4" title="Move the string offset from one code point boundary to the previous one.">U16_BACK_1_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002049">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00525">525</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="aad03daaa2706b094ea7d454d6842f8c4"></a><!-- doxytag: member="utf16.h::U16_BACK_1_UNSAFE" ref="aad03daaa2706b094ea7d454d6842f8c4" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>((s)[--(i)])) { \
        --(i); \
    } \
}
</pre></div>
<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-16.</p>
<dl><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a5f48fd46255969ea3175b3946cf4de80" title="Move the string offset from one code point boundary to the previous one.">U16_BACK_1</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002048">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00507">507</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a0a69bdb829f995ad82cb50071f578887"></a><!-- doxytag: member="utf16.h::U16_BACK_N" ref="a0a69bdb829f995ad82cb50071f578887" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">n&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    int32_t __N=(n); \
    <span class="keywordflow">while</span>(__N&gt;0 &amp;&amp; (i)&gt;(start)) { \
        <a class="code" href="utf16_8h.html#a5f48fd46255969ea3175b3946cf4de80" title="Move the string offset from one code point boundary to the previous one.">U16_BACK_1</a>(s, start, i); \
        --__N; \
    } \
}
</pre></div>
<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, handles unpaired surrogates and checks for string boundaries.</p>
<dl><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#afa230a7bea98dc8b5b3cd3d936126c6b" title="Move the string offset from one code point boundary to the n-th one before it, i...">U16_BACK_N_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002051">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00566">566</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="afa230a7bea98dc8b5b3cd3d936126c6b"></a><!-- doxytag: member="utf16.h::U16_BACK_N_UNSAFE" ref="afa230a7bea98dc8b5b3cd3d936126c6b" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">n&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    int32_t __N=(n); \
    <span class="keywordflow">while</span>(__N&gt;0) { \
        <a class="code" href="utf16_8h.html#aad03daaa2706b094ea7d454d6842f8c4" title="Move the string offset from one code point boundary to the previous one.">U16_BACK_1_UNSAFE</a>(s, i); \
        --__N; \
    } \
}
</pre></div>
<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-16.</p>
<dl><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a0a69bdb829f995ad82cb50071f578887" title="Move the string offset from one code point boundary to the n-th one before it, i...">U16_BACK_N</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002050">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00544">544</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6c79f8f5377e1d4abba0e108be553512"></a><!-- doxytag: member="utf16.h::U16_FWD_1" ref="a6c79f8f5377e1d4abba0e108be553512" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">length&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>((s)[(i)++]) &amp;&amp; (i)&lt;(length) &amp;&amp; <a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>((s)[i])) { \
        ++(i); \
    } \
}
</pre></div>
<p>Advance the string offset from one code point boundary to the next. </p>
<p>(Post-incrementing iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<dl><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a148111a5adbb596ad3b6c2e3e3cf7cec" title="Advance the string offset from one code point boundary to the next.">U16_FWD_1_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002041">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00349">349</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a148111a5adbb596ad3b6c2e3e3cf7cec"></a><!-- doxytag: member="utf16.h::U16_FWD_1_UNSAFE" ref="a148111a5adbb596ad3b6c2e3e3cf7cec" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>((s)[(i)++])) { \
        ++(i); \
    } \
}
</pre></div>
<p>Advance the string offset from one code point boundary to the next. </p>
<p>(Post-incrementing iteration.) "Unsafe" macro, assumes well-formed UTF-16.</p>
<dl><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a6c79f8f5377e1d4abba0e108be553512" title="Advance the string offset from one code point boundary to the next.">U16_FWD_1</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002040">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00332">332</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad70d5a679bd03c63131219c7808d9de9"></a><!-- doxytag: member="utf16.h::U16_FWD_N" ref="ad70d5a679bd03c63131219c7808d9de9" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">n&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    int32_t __N=(n); \
    <span class="keywordflow">while</span>(__N&gt;0 &amp;&amp; (i)&lt;(length)) { \
        <a class="code" href="utf16_8h.html#a6c79f8f5377e1d4abba0e108be553512" title="Advance the string offset from one code point boundary to the next.">U16_FWD_1</a>(s, i, length); \
        --__N; \
    } \
}
</pre></div>
<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, handles unpaired surrogates and checks for string boundaries.</p>
<dl><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a6632ab346045ebb4fa2d358f19bbd907" title="Advance the string offset from one code point boundary to the n-th next one, i.e...">U16_FWD_N_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002043">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00388">388</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6632ab346045ebb4fa2d358f19bbd907"></a><!-- doxytag: member="utf16.h::U16_FWD_N_UNSAFE" ref="a6632ab346045ebb4fa2d358f19bbd907" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">n&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    int32_t __N=(n); \
    <span class="keywordflow">while</span>(__N&gt;0) { \
        <a class="code" href="utf16_8h.html#a148111a5adbb596ad3b6c2e3e3cf7cec" title="Advance the string offset from one code point boundary to the next.">U16_FWD_1_UNSAFE</a>(s, i); \
        --__N; \
    } \
}
</pre></div>
<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-16.</p>
<dl><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#ad70d5a679bd03c63131219c7808d9de9" title="Advance the string offset from one code point boundary to the n-th next one, i.e...">U16_FWD_N</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002042">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00367">367</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa354b12f5f755fe734f957cde6d68bbe"></a><!-- doxytag: member="utf16.h::U16_GET" ref="aa354b12f5f755fe734f957cde6d68bbe" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[i]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)?">U16_IS_SURROGATE</a>(c)) { \
        uint16_t __c2; \
        <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#a6e141a548138e8c24822d219b7e06cb4" title="Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), is it a lead surrogate...">U16_IS_SURROGATE_LEAD</a>(c)) { \
            <span class="keywordflow">if</span>((i)+1&lt;(length) &amp;&amp; <a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>(__c2=(s)[(i)+1])) { \
                (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006" title="Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail...">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#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>(__c2=(s)[(i)-1])) { \
                (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006" title="Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail...">U16_GET_SUPPLEMENTARY</a>(__c2, (c)); \
            } \
        } \
    } \
}
</pre></div>
<p>Get a code point from a string at a random-access offset, without changing the offset. </p>
<p>"Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#af2c94fe2b41f2d73e7600c1ab1ca3b9b" title="Get a code point from a string at a random-access offset, without changing the offset...">U16_GET_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002035">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00197">197</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

<p>Referenced by <a class="el" href="unistr_8h_source.html#l04133">UnicodeString::char32At()</a>.</p>

</div>
</div>
<a class="anchor" id="ac1deffbf1956d9fe696129515e88f006"></a><!-- doxytag: member="utf16.h::U16_GET_SUPPLEMENTARY" ref="ac1deffbf1956d9fe696129515e88f006" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">trail&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td>&nbsp;&nbsp;&nbsp;(((<a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">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..U+10ffff) from its lead and trail surrogates. </p>
<p>The result is undefined if the input values are not lead and trail surrogates.</p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>supplementary code point (U+10000..U+10ffff) </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002029">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00111">111</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="af2c94fe2b41f2d73e7600c1ab1ca3b9b"></a><!-- doxytag: member="utf16.h::U16_GET_UNSAFE" ref="af2c94fe2b41f2d73e7600c1ab1ca3b9b" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[i]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)?">U16_IS_SURROGATE</a>(c)) { \
        <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#a6e141a548138e8c24822d219b7e06cb4" title="Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), is it a lead surrogate...">U16_IS_SURROGATE_LEAD</a>(c)) { \
            (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006" title="Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail...">U16_GET_SUPPLEMENTARY</a>((c), (s)[(i)+1]); \
        } <span class="keywordflow">else</span> { \
            (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006" title="Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail...">U16_GET_SUPPLEMENTARY</a>((s)[(i)-1], (c)); \
        } \
    } \
}
</pre></div>
<p>Get a code point from a string at a random-access offset, without changing the offset. </p>
<p>"Unsafe" macro, assumes well-formed UTF-16.</p>
<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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#aa354b12f5f755fe734f957cde6d68bbe" title="Get a code point from a string at a random-access offset, without changing the offset...">U16_GET</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002034">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

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

</div>
</div>
<a class="anchor" id="ace839ae31a801fd9c53fa67c5f8b9144"></a><!-- doxytag: member="utf16.h::U16_IS_LEAD" ref="ace839ae31a801fd9c53fa67c5f8b9144" 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>&nbsp;&nbsp;&nbsp;(((c)&amp;0xfffffc00)==0xd800)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Is this code unit a lead surrogate (U+d800..U+dbff)? </p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002025">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>.</p>

</div>
</div>
<a class="anchor" id="a35f04f1f6e7f0965a66b5268eec29b99"></a><!-- doxytag: member="utf16.h::U16_IS_SINGLE" ref="a35f04f1f6e7f0965a66b5268eec29b99" 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>&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><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002024">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>.</p>

</div>
</div>
<a class="anchor" id="ac25b589c0c9b60160d357770fad39cea"></a><!-- doxytag: member="utf16.h::U16_IS_SURROGATE" ref="ac25b589c0c9b60160d357770fad39cea" 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>&nbsp;&nbsp;&nbsp;U_IS_SURROGATE(c)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Is this code unit a surrogate (U+d800..U+dfff)? </p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002027">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>.</p>

</div>
</div>
<a class="anchor" id="a6e141a548138e8c24822d219b7e06cb4"></a><!-- doxytag: member="utf16.h::U16_IS_SURROGATE_LEAD" ref="a6e141a548138e8c24822d219b7e06cb4" 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>&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#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)?">U16_IS_SURROGATE(c)</a>), is it a lead surrogate? </p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002028">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>.</p>

</div>
</div>
<a class="anchor" id="a1da8c1409deafe3ac32a8ab506086c10"></a><!-- doxytag: member="utf16.h::U16_IS_SURROGATE_TRAIL" ref="a1da8c1409deafe3ac32a8ab506086c10" args="(c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_SURROGATE_TRAIL</td>
          <td>(</td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td>&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#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)?">U16_IS_SURROGATE(c)</a>), is it a trail surrogate? </p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000127">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 4.2 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00092">92</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="afe8d9f450b9297897f018c2f23eb0724"></a><!-- doxytag: member="utf16.h::U16_IS_TRAIL" ref="afe8d9f450b9297897f018c2f23eb0724" 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>&nbsp;&nbsp;&nbsp;(((c)&amp;0xfffffc00)==0xdc00)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Is this code unit a trail surrogate (U+dc00..U+dfff)? </p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002026">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>.</p>

</div>
</div>
<a class="anchor" id="ad0e832d06991f5f07a43d68d202165b1"></a><!-- doxytag: member="utf16.h::U16_LEAD" ref="ad0e832d06991f5f07a43d68d202165b1" 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>&nbsp;&nbsp;&nbsp;(<a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((supplementary)&gt;&gt;10)+0xd7c0)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the lead surrogate (0xd800..0xdbff) for a supplementary code point (0x10000..0x10ffff). </p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>lead surrogate (U+d800..U+dbff) for supplementary </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002030">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>.</p>

</div>
</div>
<a class="anchor" id="add0a383d49e1ca81e2920d25883a56a9"></a><!-- doxytag: member="utf16.h::U16_LENGTH" ref="add0a383d49e1ca81e2920d25883a56a9" 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>&nbsp;&nbsp;&nbsp;((uint32_t)(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..U+10ffff). </p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 or 2 </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002032">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00140">140</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab14454ab71a81f0cf86e523e50690eee"></a><!-- doxytag: member="utf16.h::U16_MAX_LENGTH" ref="ab14454ab71a81f0cf86e523e50690eee" 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..U+10ffff). </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>2 </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002033">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00147">147</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

<p>Referenced by <a class="el" href="unistr_8h_source.html#l04323">UnicodeString::append()</a>, and <a class="el" href="unistr_8h_source.html#l04018">UnicodeString::replace()</a>.</p>

</div>
</div>
<a class="anchor" id="a844bb48486904fdca40c8b883e9c80ee"></a><!-- doxytag: member="utf16.h::U16_NEXT" ref="a844bb48486904fdca40c8b883e9c80ee" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[(i)++]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>(c)) { \
        uint16_t __c2; \
        <span class="keywordflow">if</span>((i)&lt;(length) &amp;&amp; <a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>(__c2=(s)[(i)])) { \
            ++(i); \
            (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006" title="Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail...">U16_GET_SUPPLEMENTARY</a>((c), __c2); \
        } \
    } \
}
</pre></div>
<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, handles unpaired surrogates and checks for string boundaries.</p>
<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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#ae98a64ae0f42bc6ad4179293c3638be4" title="Get a code point from a string at a code point boundary offset, and advance the offset...">U16_NEXT_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002037">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00261">261</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae98a64ae0f42bc6ad4179293c3638be4"></a><!-- doxytag: member="utf16.h::U16_NEXT_UNSAFE" ref="ae98a64ae0f42bc6ad4179293c3638be4" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[(i)++]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>(c)) { \
        (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006" title="Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail...">U16_GET_SUPPLEMENTARY</a>((c), (s)[(i)++]); \
    } \
}
</pre></div>
<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-16.</p>
<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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a844bb48486904fdca40c8b883e9c80ee" title="Get a code point from a string at a code point boundary offset, and advance the offset...">U16_NEXT</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002036">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00234">234</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a592fa1f80da119e1c4565dc9193c18d9"></a><!-- doxytag: member="utf16.h::U16_PREV" ref="a592fa1f80da119e1c4565dc9193c18d9" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[--(i)]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>(c)) { \
        uint16_t __c2; \
        <span class="keywordflow">if</span>((i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>(__c2=(s)[(i)-1])) { \
            --(i); \
            (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006" title="Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail...">U16_GET_SUPPLEMENTARY</a>(__c2, (c)); \
        } \
    } \
}
</pre></div>
<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, handles unpaired surrogates and checks for string boundaries.</p>
<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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a4cccc93c8a8e5d438ff6d0371a7a3937" title="Move the string offset from one code point boundary to the previous one and get the...">U16_PREV_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002047">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00485">485</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a4cccc93c8a8e5d438ff6d0371a7a3937"></a><!-- doxytag: member="utf16.h::U16_PREV_UNSAFE" ref="a4cccc93c8a8e5d438ff6d0371a7a3937" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">c&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    (c)=(s)[--(i)]; \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>(c)) { \
        (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006" title="Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail...">U16_GET_SUPPLEMENTARY</a>((s)[--(i)], (c)); \
    } \
}
</pre></div>
<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-16.</p>
<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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a592fa1f80da119e1c4565dc9193c18d9" title="Move the string offset from one code point boundary to the previous one and get the...">U16_PREV</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002046">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00457">457</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3d5ff64af4bf16cbf9a830743a5c74a4"></a><!-- doxytag: member="utf16.h::U16_SET_CP_LIMIT" ref="a3d5ff64af4bf16cbf9a830743a5c74a4" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">length&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>((start)&lt;(i) &amp;&amp; (i)&lt;(length) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>((s)[(i)-1]) &amp;&amp; <a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>((s)[i])) { \
        ++(i); \
    } \
}
</pre></div>
<p>Adjust a random-access offset to a code point boundary after a code point. </p>
<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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a4d3e9ee47d4fdb9fbf93a98ee1248c81" title="Adjust a random-access offset to a code point boundary after a code point.">U16_SET_CP_LIMIT_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002053">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00608">608</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

<p>Referenced by <a class="el" href="unistr_8h_source.html#l04158">UnicodeString::getChar32Limit()</a>.</p>

</div>
</div>
<a class="anchor" id="a4d3e9ee47d4fdb9fbf93a98ee1248c81"></a><!-- doxytag: member="utf16.h::U16_SET_CP_LIMIT_UNSAFE" ref="a4d3e9ee47d4fdb9fbf93a98ee1248c81" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>((s)[(i)-1])) { \
        ++(i); \
    } \
}
</pre></div>
<p>Adjust a random-access offset to a code point boundary after a code point. </p>
<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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a3d5ff64af4bf16cbf9a830743a5c74a4" title="Adjust a random-access offset to a code point boundary after a code point.">U16_SET_CP_LIMIT</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002052">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00587">587</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a31c914801f71204ee90caa6c4d0c3c1b"></a><!-- doxytag: member="utf16.h::U16_SET_CP_START" ref="a31c914801f71204ee90caa6c4d0c3c1b" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>((s)[i]) &amp;&amp; (i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144" title="Is this code unit a lead surrogate (U+d800..U+dbff)?">U16_IS_LEAD</a>((s)[(i)-1])) { \
        --(i); \
    } \
}
</pre></div>
<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 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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#ade68651cb87ae4cd94cec2d0036ac9c6" title="Adjust a random-access offset to a code point boundary at the start of a code point...">U16_SET_CP_START_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002045">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00429">429</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

<p>Referenced by <a class="el" href="unistr_8h_source.html#l04147">UnicodeString::getChar32Start()</a>.</p>

</div>
</div>
<a class="anchor" id="ade68651cb87ae4cd94cec2d0036ac9c6"></a><!-- doxytag: member="utf16.h::U16_SET_CP_START_UNSAFE" ref="ade68651cb87ae4cd94cec2d0036ac9c6" 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, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">i&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
    <span class="keywordflow">if</span>(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724" title="Is this code unit a trail surrogate (U+dc00..U+dfff)?">U16_IS_TRAIL</a>((s)[i])) { \
        --(i); \
    } \
}
</pre></div>
<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 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><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>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="utf16_8h.html#a31c914801f71204ee90caa6c4d0c3c1b" title="Adjust a random-access offset to a code point boundary at the start of a code point...">U16_SET_CP_START</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002044">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00409">409</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5b15d2eeb271d0a6d92c854681ebaf20"></a><!-- doxytag: member="utf16.h::U16_SURROGATE_OFFSET" ref="a5b15d2eeb271d0a6d92c854681ebaf20" 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 class="internal"><dt><b><a class="el" href="internal.html#_internal000123">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="utf16_8h_source.html#l00098">98</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="abf0698cf645946911b2e10d3ab890321"></a><!-- doxytag: member="utf16.h::U16_TRAIL" ref="abf0698cf645946911b2e10d3ab890321" 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>&nbsp;&nbsp;&nbsp;(<a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((supplementary)&amp;0x3ff)|0xdc00)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the trail surrogate (0xdc00..0xdfff) for a supplementary code point (0x10000..0x10ffff). </p>
<dl><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>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>trail surrogate (U+dc00..U+dfff) for supplementary </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002031">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>.</p>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"/><address style="text-align: right;"><small>Generated on 16 Mar 2010 for ICU 4.4 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>