From UTF8 text in API to EBCDIC in iDB2


We expose an RestApi and the data we get has to be inserted in an iDB2 table. 

The problem we have is that on the API the data is in UTF8 in the OutSystems platform to me it seems it's ANSI and when we insert it in the database (were the code page is EBCDIC, codepage 937) the special chars are gone.

So we get : "shipping_address_state": "M\u00fcnchen",

We put it in a struct in a text is looks like : "shipping_address_state": "München",

The record in the database is  "shipping_address_state":"Mnchen"

Its on the cloud enviroment.

Hope someone can help.

Regards Robert de Vries

Hi Robert,

The OutSystems Platform is fully UTF-8 as well, so if the REST API sends UTF-8 the data should arrive fine in the Platform when consuming it, provided that the REST API advertises itself as such ("Content-Type: application/json; charset=utf-8"). If it fails to explicitly mention it is sending utf-8, the platform might assume ISO-8859-1, and conversion errors will occur.

As for inserting it into an EBCDIC database, you will need to explicitly convert UTF-8 to EBCDIC. Obviously the Platform doesn't supply support for such an ancient system out of the box :).

Hello Kilian,

Thanks for your answer. The API part is as indeed with charset = utf-8 so that part is right.

The problem is indeed the convert UTF-8 to EBCDIC. They all work with binary data but the database excepts an text. I have already tried in the intergration to set the data type to binary for one field but this still doesn't give the right result. 

This morning I had a chat with our DBA he tolt me probaly the driver settings should be set to this code page. But this is an cloud enviroment so I think I have to open an case at OutSystems.