2
數據庫(11g)字符集是US7ASCII,我試圖用UTF-8編碼構建一些XML。Oracle - 生成包含多字節字符的XML,LPX-00216錯誤
我正在使用轉換處理(或者所以我在想)US7ASCII到UTF8部分。
示例代碼:
declare
v_text2 varchar2(100);
v_text2_conv varchar2(100);
v_xml varchar2(1000);
begin
select building_name into v_text2 from adam_source; -- grab some multibyte data
select convert(trim(v_text2),'UTF8','US7ASCII') into v_text2_conv from dual; -- convert to UTF8
select xmlroot(xmlelement("test2",XMLCDATA(v_text2_conv)),version '1.0" encoding="UTF- 8').getclobval() into v_xml from dual; -- Build XML
dbms_output.put_line(v_xml); -- Display XML
end;
/
我得到的錯誤:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00216: invalid character 239 (0xEF)
任何指針非常感謝!