Skip to content

Commit

Permalink
# appended to strings with special unicode characters; fix #211
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Apr 29, 2021
1 parent b379056 commit d875d26
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/nwrfcsdk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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<Napi::String>());
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;
}
Expand Down

0 comments on commit d875d26

Please sign in to comment.