Skip to Main Content

Insert bfilename file.xml changes encoding entity to windows-1252

magicliverMay 1 2014 — edited Jun 11 2014

Hi, I am running Oracle 11.2.0.1 and I am trying to insert xml from a .xml file in a windows directory into a table new_xmldata with a single xmltype field. The database characterset is set to AL32UTF8. The xml encoding is 'UTF-8' and this is in the header entity. I have checked the encoding by opening the file in XMLSpy and also if I open the file and 'save as', again the encoding is listed as UTF-8. Then I run the code

insert into new_xmldata values (XMLTYPE(bfilename('IMPORT_DIRECTORY', 'file.xml'), nls_charset_id ('AL32UTF8')));

Now when I select the data in the record the XML encoding entity declares the encoding as WINDOWS-1252.

Why is the encoding changing and what can I do to prevent this? (Sorry I would like to provide the data as an example but I work on a secure site and cannot upload this?)

Many thanks in advance to any that can help.

Comments
Post Details
Added on May 1 2014
5 comments
2,595 views