From d875d264d58db2b267dea857f37f2757ead28eca Mon Sep 17 00:00:00 2001 From: bsrdjan Date: Thu, 29 Apr 2021 16:12:42 +0200 Subject: [PATCH] # appended to strings with special unicode characters; fix #211 --- src/nwrfcsdk.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nwrfcsdk.cc b/src/nwrfcsdk.cc index 13736ac..2bf1175 100644 --- a/src/nwrfcsdk.cc +++ b/src/nwrfcsdk.cc @@ -46,7 +46,7 @@ namespace node_rfc sapuc = (SAP_UC *)mallocU(sapucSize); memsetU((SAP_UTF16 *)sapuc, 0, sapucSize); rc = RfcUTF8ToSAPUC((RFC_BYTE *)&sstr[0], sapucSize - 1, sapuc, &sapucSize, &resultLen, &errorInfo); - // EDEBUG("fill: ", sstr, " sapucSize: ", sapucSize, " resultLen: ", resultLen, " code: ", errorInfo.code); + EDEBUG("fill: ", sstr, " sapucSize: ", sapucSize, " resultLen: ", resultLen, " code: ", errorInfo.code); if (rc != RFC_OK) { @@ -220,9 +220,8 @@ namespace node_rfc err << "String expected from NodeJS for the field of type " << typ; return nodeRfcError(err.str(), errorPath); } - std::string sstr = std::string(value.As()); - cValue = setString(sstr); - rc = RfcSetString(functionHandle, cName, cValue, sstr.length(), &errorInfo); + cValue = setString(value.ToString()); + rc = RfcSetString(functionHandle, cName, cValue, strlenU(cValue), &errorInfo); free(cValue); break; }