utf-8 in HTP Output window

Worker

Member³
Running the following Test script:

Code:
DECLARE
    testString VARCHAR2(100) := UNISTR('abc \00e5\00f1\00f6 \65E5\672C');
BEGIN
    DBMS_OUTPUT.put_line(testString);
    HTP.prn(testString);
END;

Results in the DBMS Output containing this:
abc åñö 日本

And the HTP Output containing this:
abc есц ??

I have tried making HTP output the header "Content-type: text/html; charset=utf-8" via the following code, but that doesn't seem to make a difference to the HTP Output window:

Code:
DECLARE
    cgiVarName    owa.vc_arr;
    cgiVarValue    owa.vc_arr;
    testString VARCHAR2(100) := UNISTR('abc \00e5\00f1\00f6 \65E5\672C');
BEGIN
    cgiVarName(1)    := 'REQUEST_IANA_CHARSET';
    cgiVarValue(1)    := 'utf-8';
    owa.init_cgi_env(cgiVarName.COUNT, cgiVarName, cgiVarValue);
    DBMS_OUTPUT.put_line(testString);
    HTP.prn(testString);
END;

Is there something wrong with the HTP Output window, or is there a setting I'm missing?

(PL/SQL Developer 16.0.8.2176 on Windows 11. Oracle instant client 23.9. Oracle database 19c.)
 
This does indeed not work correctly for utf-8 characters. Unfortunately there is no workaround at the moment.

We have fixed this for the next release.
 
Back
Top