Forum Stats

  • 3,758,592 Users
  • 2,251,416 Discussions
  • 7,870,258 Comments

Discussions

Register XSD with UTF-8 encoding

no_id_i_need
no_id_i_need Member Posts: 14 Blue Ribbon
edited Dec 10, 2013 11:50AM in PL/SQL XML Programming

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?

Tagged:

Answers

  • odie_63
    odie_63 Member Posts: 8,439 Bronze Badge
    edited Dec 10, 2013 2:56AM
    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.

  • Marco Gralike
    Marco Gralike Member Posts: 4,491 Silver Trophy
This discussion has been closed.