title: Convert Unicode code points to UTF-8 and UTF-32
body: <p>I can't think of a way to remove the leading zeros. My goal was in a <code>for</code> loop to then create the UTF-8 and UTF-32 versions of each number.</p>
  
  <p>For example, with UTF-8 wouldn't I have to remove the leading zeros? Does anyone have a solution for how to pull this off? Basically what I am asking is: does someone have a easy solution to convert Unicode code points to UTF-8?</p>
  
  <pre><code>    for (i = 0x0; i &lt; 0xffff; i++) {
          printf("%#x \n", i);
          //convert to UTF8
      }
  </code></pre>
  
  <p>So here is an example of what I am trying to accomplish for each <code>i</code>.</p>
  
  <ul>
  <li>For example: Unicode value U+0760 (Base 16) would convert to UTF8 as
  
  <ul>
  <li>in binary: 1101 1101  1010 0000</li>
  <li>in hex: DD A0</li>
  </ul></li>
  </ul>
  
  <p>Basically I am trying to do that for every <code>i</code> is convert it to its hex equivalent in UTF-8.</p>
  
  <p>The problem I am running into is it seems the process for converting Unicode to UTF-8 involves removing leading 0s from the bit number. I am not really sure how to do that dynamically.</p>