When Using DBMS_LOB.CONVERTTOCLOB French Characters With An Accent Are Replaced (Doc ID 436168.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version: 9.2.0.8
This problem can occur on any platform.

Symptoms

When using DBMS_LOB.CONVERTTOCLOB on a UTF8 database to convert a BLOB to a CLOB then the output is wrong. Instead of 

          dgdgd,route de l'université Bejaia

the output is:

          dgdgd,route de l'universit¿ejaia

or

          dgdgd,route de l'université ‚ejaia

Code:

desc test:

Name   Type
-----------------
ID NUMBER
TEXT BLOB

DECLARE
 v_maxsize INTEGER := DBMS_LOB.LOBMAXSIZE;
 v_dest_offset INTEGER := 1;
 v_src_offset INTEGER := 1;
 v_default_csid INTEGER := DBMS_LOB.DEFAULT_CSID;
 v_lang_context INTEGER := DBMS_LOB.DEFAULT_LANG_CTX;
 v_warning INTEGER;
 CBLOB BLOB;
 CCLOB CLOB;
 CURSOR lob_data IS
    select text from test;
BEGIN
   OPEN lob_data;
     FETCH lob_data INTO cblob;
   CLOSE lob_data;
   DBMS_LOB.CREATETEMPORARY( cclob, TRUE); 
   DBMS_LOB.CONVERTTOCLOB( cclob,
      cblob,
      v_maxsize,
      v_dest_offset,
      v_src_offset,
      v_default_csid,
      v_lang_context,
      v_warning );
   dbms_output.put_line(cclob);
END;
/

dgdgd,route de l'universit¿ejaia

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms