Kbase P157675: SonicMQ Adapter:gets Can't PUT past the end of the MEMPTR. (4791) with Unicode
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  21/12/2009 |
|
Status: Unverified
SYMPTOM(s):
SonicMQ Adapter:gets Can't PUT past the end of the MEMPTR. (4791) with Unicode
Gets error 4791 after setting the memory size for a MEMPTR variable for received Unicode XMLMessage /TextMessage.
FACT(s) (Environment):
Using getCharCount() function to setting the memory size for a MEMPTR variable for received Unicode XMLMessage /TextMessage.
Sample code: SET-SIZE(memptrDoc) = DYNAMIC-FUNCTION('getCharCount' IN messageH) + 1.
The sample code set memory size correctly when starts Client Session with default ISO8859-1 code page.
The same code set memory size incorrectly when starts Client Session with utf-8 codepage (-cpinternal UTF-8 -cpstream UTF-8).
getCharCount() returns less integer with utf-8 codepage, hence gets error message "Cannot PUT past the end of the MEMPTR. (4791)" later.
All Supported Operating Systems
OpenEdge 10.1C
CAUSE:
getCharCount() is correctly returning the size in characters unit. In the sample code, the return value from getCharCount() is put into a MEMPTR which needs the byte size.
FIX:
When the session codepage is utf-8, it would have to multiply the size returned by 3 to accommodate the max size of the string in bytes.
Or a LONGCHAR can be used instead and just concatenate the values - obviously that adds more overhead but it's an option.