XML - CLOB - CharacterSet Problem [message #134311] |
Wed, 24 August 2005 04:46 |
marrec
Messages: 35 Registered: May 2005 Location: Mühlheim, Germany
|
Member |
|
|
hello,
i'm having a prob with charactersets.
i programmed a xml-solution, which writes a xml-file using xmldom. this file can contain umlaut (ä,ö etc.).
i load the file into another database using following code:
l_bfile := BFILENAME('VR_XML_IN', p_filename);
DBMS_LOB.createtemporary (l_clob, TRUE);
DBMS_LOB.fileopen(l_bfile, DBMS_LOB.file_readonly);
DBMS_LOB.loadfromfile(l_clob, l_bfile, DBMS_LOB.getlength(l_bfile));
DBMS_LOB.fileclose(l_bfile);
INSERT INTO XML_TABLE (
CONTENT)
VALUES
(
XMLTYPE.CreateXML(l_clob)
);
in out test-environment this works very well - we use characterset: WE8MSWIN1252
in real-environment, all umlauts are changed - when i debug with toad, i watch l_clob and see, instead of 'ä' vice versa question marks and stuff like this.
They work with: WE8ISO8859P15.
Both use MS-Windows 2k Server as Database Server OS.
Oracle Version is 9.2.x
maybe someone who knows a solution?
thx in advance,
marrec
|
|
|
Re: XML - CLOB - CharacterSet Problem [message #134370 is a reply to message #134311] |
Wed, 24 August 2005 09:46 |
marrec
Messages: 35 Registered: May 2005 Location: Mühlheim, Germany
|
Member |
|
|
so, after a lot of test an readings i'm one step further.
the output routine, uses following code to export xml-data to a file:
DBMS_LOB.CreateTemporary(v_xml_clob, TRUE);
xmldom.writetoclob(doc,v_xml_clob);
v_xml_content := new xmltype(v_xml_clob);
INSERT INTO XML_TAG
(CONTENT)
VALUES ( v_xml_content);
xmldom.writeToFile(doc, v_path || '\' || v_filename);
So in my xml-type column in table XML_TAB, everything is okay!
but in the output-file there is no umlaut.
can i write the xml-data with this function in some other format like UTF8 or ISO8859-1?
|
|
|
Re: XML - CLOB - CharacterSet Problem [message #134477 is a reply to message #134370] |
Thu, 25 August 2005 02:46 |
marrec
Messages: 35 Registered: May 2005 Location: Mühlheim, Germany
|
Member |
|
|
yippieheiye,
i got it!
with the function xmldom.getCharSet i saw that the xmldocument had the character set 'AL32UTF8'.
xmldom.writeToClob converted this to database standard characterset. xmldom.writeToFile didn't!
with function xmldom.setCharSet i converted xml-document to WE8ISO8859P1, and now it works!
unfortunately WE8ISO8859P15 seems to be not supported, so i can't use € euro currency symbol.
so far,
marrec
|
|
|