This discussion is archived
2 Replies Latest reply: Dec 10, 2013 8:50 AM by MarcoGralike RSS

Register XSD with UTF-8 encoding

no_id_i_need Newbie
Currently Being Moderated

Hello,

Could anyone help me solving my problem.

I want to register XSD with encoding UTF-8 into database where encoding is set to Windows-1257.

I use:

dbms_xmlschema.registerschema('myurl', '<?xml version="1.0" encoding="UTF-8"?> <xs:schema ...', TRUE, FALSE, FALSE, FALSE);

But when I get value from ALL_XML_SCHEMAS I see: <?xml version="1.0" encoding="WINDOWS-1257"?> <xs:schema...'

Can anyone tell me why and how to change it to UTF-8?

  • 1. Re: Register XSD with UTF-8 encoding
    odie_63 Guru
    Currently Being Moderated

    no_id_i_need wrote:

     

    Hello,

    Could anyone help me solving my problem.

    I want to register XSD with encoding UTF-8 into database where encoding is set to Windows-1257.

    I use:

    dbms_xmlschema.registerschema('myurl', '<?xml version="1.0" encoding="UTF-8"?> <xs:schema ...', TRUE, FALSE, FALSE, FALSE);

    But when I get value from ALL_XML_SCHEMAS I see: <?xml version="1.0" encoding="WINDOWS-1257"?> <xs:schema...'

    Can anyone tell me why and how to change it to UTF-8?

    You cannot.

    You can only load XML schemas (and XML documents in general) in your database character set.

    If the input document is not in the db charset, then Oracle automatically converts it while loading. It may result in character conversion loss if there's no match in the target charset.

     

    Does your XSD use UTF-8 encoded characters that don't have a match in Windows-1257 ?

     

    If it's just a display issue, you can set your NLS_LANG client setting to AL32UTF8 (if supported) and the schema will be converted back to UTF-8 when queried.

  • 2. Re: Register XSD with UTF-8 encoding
    MarcoGralike Oracle ACE Director
    Currently Being Moderated

    The following might apply: Conversion UTF-8 -> WINDOWS-1250

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points