Search code examples
character-encodingcontent-typeorbeon

Specifiy Response charset for CRUD-API


I access the endpoint "/fr/service/persistence/crud/$app/$form/form.xhtml" using the built-in tools of DB2:

values systools.HTTPGETCLOB('https://.../fr/service/persistence/crud/$app/$form/form.xhtml', '<httpHeader><header name ="accept" value="application/xml; charset=utf-8"/><header name ="Orbeon-Form-Definition-Version" value="1"/></httpHeader>');

The data is stored in a PostgreSQL database which is encoded in utf-8. My problem is that the umlauts are not displayed correctly, because DB2 insists that the charset is also specified in the content type. However, Orbeon only returns "application/xml" as the Content-Type. I have created a mock server that specifies Content-Type plus charset and then DB2 has no problems with correctly displaying the umlauts.

Is there a way to configure Orbeon to include the charset with the Content-Type?

Additional Information:

  • Tomcat 9.0.50

Any guidance and assistance is appreciated!


Solution

  • There is currently no way to specify that, sorry.

    application/xml does not require a charset parameter, as the XML document itself can specify a character encoding, and XML defaults to UTF-8 if nothing else is available anyway. So I am not even sure it would be a good idea to pass a charset parameter in addition, although it probably wouldn't hurt. But again, this is not configurable at the moment so you'll have to find a workaround.