title: How to encode code point list into UTF8 chunk using libICU?
body: <p>Due to program requirements (fast access to individual characters), I am using <code>uint32_t[]</code> for characters. Simply stores <em>code points</em>, not UTF-32 <em>code units</em>. because I don't think UTF-32 code-unit and Unicode code-point is same thing, so I have to keep them separated. </p>
  
  <p>The code points are taken from <a href="http://icu-project.org/apiref/icu4c/classicu_1_1ForwardCharacterIterator.html#acccb6c5e433ff1cbaa5830130b569e97" rel="nofollow"><code>next32PostInc</code> function</a></p>
  
  <p>And I need to encode these code-points into UTF-8 chunk using <code>libICU</code>, and it's hard to find character level accumulative encoder. I see a way by using <a href="http://icu-project.org/apiref/icu4c/classicu_1_1UnicodeString.html#a63a20b07358283970202766775a36adc" rel="nofollow"><code>UnicodeString::append()</code></a>, but it needs double conversions. <a href="http://icu-project.org/apiref/icu4c/ucnv_8h.html#a2bdb6b1d3ac4069808348eb6961ce63d" rel="nofollow"><code>ucnv_convert</code></a> functions seems to do the job, but only with UTF-32 <em>code units</em>. And I really am not sure about safety if I use them with <em>code points</em>. Currently I am looking for something inverse of <code>next32PostInc</code> function. How can I do that? If my idea on code-point and code-units, please correct me.</p>