HTP.P package is not working properly with variable-length AL32UTF8 encodings when some characters come in place. Maybe we are doing something wrong or a bad setup but it is just a print and it happens with prebuilt oracle VM provided by Oracle. We already reported this in Oracle Support two months ago with bearly any answer or hotfix in this case: SR 3-27870927971
The error is ORA-06502: PL/SQL: numeric or value error
Just have those examples and try to execute them on any database version with AL32UTF8 as encoding. You can even try provided Oracle VM at (https://www.oracle.com/database/technologies/databaseappdev-vm.html)
-----------------------------------------------------
Example 1 (Provided by Oracle support):
begin
owa.num_cgi_vars := 0;
htp.init;
htp.htmlopen;
htp.p(rpad('�',128,'�'));
htp.htmlclose;
owa_util.showpage;
end;
(It works without errors up to 85 chars, anything beyond that fails). It is not calculating properly the length of the internal buffer of 256 byte per line for this encoding. This is something I already read somwhere else and seems the same issue.
---------------------------------------------------------
Example 2 (Failing example on our side):
begin
htp.p(q'[
<div class="ccentral_blau"><div class="calendari_organ"><a name="1_1"></a><h2 class="titol_caixa_blau"><span>Recursos</span></h2>
<div class="llista_simple">
<ul class="pagina_llistat llista_resaltada" style="padding: 0em 0 0;">
<li style="font-weight:normal;">
<h2><a href="/web/composicio/fonts-informacio/index.html?p_id=DOC_CAPCIT_1" title="Dins de: Espai de documentació del CAPCIT, vegeu Accés a l'espai de documentació">Accés a l'espai de documentació</a></h2>
<p></p>
</li>
<li style="font-weight:normal;">
<h2><a href="/web/composicio/fonts-informacio/index.html?p_id=BUT_CAPCIT_1" title="Dins de: Espai de documentació del CAPCIT, vegeu Butlletí del CAPCIT">Butlletí del CAPCIT</a></h2>
<p></p>
</li> </ul>
</div></div></div>
]');
end;
/