Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

http client, unicode system, unicode->utf-8

petr_hanek
Explorer
0 Likes
1,598

Hello,

please, I have problem with download correct data (or decode downloaded data to correct format) from HTTPS server on UNICODE system.

When I'm trying to call HTTP2_GET to RFC destination SAPHTTP (frontend), result is correct. This RFC destination is non-UNICODE connection to saphttp.exe

I can download data from https:// .... and everything is perfect.

Response from HTTP2_GET is coded as UTF-8 and calls SCMS_STRING_TO_XSTRING (encoding 1404) and SMUM_XML_PARSE work fine.

When I try to download data using SAPHTTPA destination (saphttp.exe on application server), I have problem with response data. ASCII characters are correct, but national chars are coded as unicode. I don't know, how can I decode these chars.

SAPHTTPA is connection to UNICODE target system saphttp.exe. (character size = 2)

Response body length from SAPHTTPA is 2x greater than response body length from SAPHTTP (frontend).

Please, how can I decode downloaded unicode data to xstring using encoding 1404 or how can I download data in UTF-8 format using unicode rfc destination?

Thx,

Petr

2 REPLIES 2
Read only

petr_hanek
Explorer
0 Likes
876

If you try download data using HTTP2_GET and UNICODE RFC destination SAPHTTPA, you'll need to covert data using SCMS_STRING_TO_XSTRING without parameter encoding. Result is correct. Than you can call SMUM_XML_PARSE without problem.

If you need parse part of result SMUM_XML_PARSE (xml in xml), next call SCMS_STRING_TO_XSTRING is needed with parameter encoding = '4110' ...

Result is not converted and next call SMUM_XML_PARSE is correct.

If you download data using HTTP2_GET and NON-UNICODE RFC destination SAPHTTP, use your national codepage as parameter in first encoding and second encoding is without parameter 'encoding'.

Petr

Read only

petr_hanek
Explorer
0 Likes
876

MIY