title: Emoji characters breaking the Apex HTTP Engine?
body: <p>When I output Emoji Characters like the ones below in Apex anywhere on the Page, the HTTP Output gets broken.</p>
  
  <p><em>Figure 1 - example Emojis:</em></p>
  
  <p>       </p>
  
  <p><em>Figure 2 - broken HTML</em></p>
  
  <p><a href="https://i.stack.imgur.com/j5do6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j5do6.png" alt="enter image description here"></a></p>
  
  <p>With broken I mean, seemingly random character on the page disappear, and as you all may know this can lead to the whole page not being rendered correctly.</p>
  
  <p>For me it seems like it's a characterset problem - maybe Apex isn't able to calculate the correct Length or something?</p>
  
  <p>I am using Oracle Apex 18.1 on apex.oracle.com.</p>
  
  <p><strong>Steps to Reproduce:</strong></p>
  
  <ol>
  <li>Go to <a href="https://apex.oracle.com/pls/apex/f?p=51681" rel="nofollow noreferrer">https://apex.oracle.com/pls/apex/f?p=51681</a></li>
  <li>Enter 1000 into the Normal Icon Count Field and press Render</li>
  <li>1000 hearts will appear</li>
  <li>Enter 1000 into the Emoji Count field and press Render</li>
  <li>The HTML will break somewhere (and maybe ~1000 Emojis will appear)</li>
  </ol>
  
  <p>The Code to output the Characters is in a dynamic PL/SQL Region and looks as following:</p>
  
  <pre><code>DECLARE
      l_text VARCHAR2(10) := '♥';
  BEGIN
      FOR i IN 1.. NVL(:P1_EMOJICOUNT_1,10) LOOP
          htp.p('&lt;span id="myDiv'||i||'"&gt;'|| l_text ||'&lt;/span&gt;');
      END LOOP;
  END;
  </code></pre>