Closed BlackmanCC closed 3 years ago
this is when calling the API provided by https://github.com/abaplint/abaplint-sci-server ?
yes, I am running the API in a docker container on our internal linux server.
is the source ABAP system running unicode?
no. like I said the system is non-unicode. We will switch to unicode system in the 1st quarter of next year
okay, I missed that part 😄
as far as I remember, there is some way to set the encoding by the http client, need it somewhere around https://github.com/abaplint/abaplint-sci-client/blob/master/src/zcl_abaplint_backend_api_agent.clas.abap#L131
iv_payload
must be converted to UTF8, and then use set_data
instead, plus set charset http header field
I think, header field could be set by
o_client->request->set_header_field( name = 'Content-Type'
value = 'text/xml; charset=utf-8' ).
but, how to convert iv_payload
to UTF8?
call ZCL_ABAPGIT_CONVERT=>STRING_TO_XSTRING_UTF8
I should only convert the contents of iv_payload
before building the json, right?
I could do it in ZCL_ABAPLINT_BACKEND->BASE64_ENCODE
?
this not works for now:
API request failed [500]: [abaplint] JSON5: invalid
character '�' at 1:1 ()
whats your code in the client?, it should be something like,
IF iv_method = 'POST' AND iv_payload IS NOT INITIAL. " OR PUT ... maybe in future
li_client->request->set_data( ZCL_ABAPGIT_CONVERT=>STRING_TO_XSTRING_UTF8( iv_payload ) ).
li_client->request->set_header_field( name = 'Content-Type' value = 'application/json; charset=utf-8' ).
ENDIF.
but yea, hmm, there might be multiple places that needs changing
I will look into it tomorrow, but I will need some of your help for sure. I am currently getting slowly better into that things ;-)
will try it out thanks a lot
seems to work now. It get LINT_* errorcodes now.
Thank you very much!
fixed, closing
When I run the sci check againt abaplint backend. I get the error:
API request failed [500]: unsupported charset "ISO-8859-1"
Our System is an 740 non-unicode system.
Do you have ideas how I can fix this?