Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to verify the encoding of a blob file

AlibuneJun 15 2018 — edited Jun 15 2018

Hi everyone!

I have a browse item on my application that get the xml file and put it into a xmltype column on my table and i'm using this process:

declare 

  l_xml      xmltype; 

  l_xml_blob apex_application_temp_files.blob_content%type; -- blob; 

  l_filename apex_application_temp_files.filename%type; 

begin 

 

  select f.blob_content,f.filename 

    into l_xml_blob,l_filename 

    from apex_application_temp_files f 

    where f.name = :P201_XMLFILE; 

 

  --create xmltype from blob 

  l_xml := xmltype(l_xml_blob, nls_charset_id('UTF8'));--specify file encoding 

 

  --and now just insert the record 

  insert into xml_tab(id,filename,xml) values (xml_tab_seq.NEXTVAL,l_filename,l_xml);  

 

end; 

but sometimes i'll get files with encoding that is not UTF-8, how can i veriffy the file encoding to define which type of code i will use?

I'm using Oracle APEX 5.1 and Oracle Database 11G XE.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2018
Added on Jun 15 2018
5 comments
3,825 views