Consultor Eletrônico



Kbase P153081: X-document SAVE to LONGCHAR variable fails silently
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/22/2009
Status: Unverified

SYMPTOM(s):

X-document SAVE to LONGCHAR variable fails silently

LONGCHAR variable has length of zero bytes after XML document is saved into it.

LONGCHAR variable appears blank when displayed after XML document is saved into it.

SAVE method returns TRUE in spite of the fact that no data was saved into the variable.

ERROR-STATUS:ERROR is FALSE in spite of the fact that no data was saved into the variable.

ERROR-STATUS:NUM-MESSAGES is zero in spite of the fact that no data was saved into the variable.

FACT(s) (Environment):

Saving to a MEMPTR variable works correctly.
XML document is encoded UTF-8.
SESSION:CPINTERNAL is ISO8859-1.
Windows
OpenEdge 10.x

CAUSE:

Bug# OE00191182

CAUSE:

In this case, the SAVE failed because several characters in the XML document existed in the UTF-8 code page used by the XML, but not in the default ISO8859-1 code page used by the LONGCHAR variable in the procedure. It is expected behavior that the SAVE failed, because the result would not have been a valid LONGCHAR value. The bug consists of the fact that neither the method return value nor the ERROR-STATUS handle gives any indication of the problem.

FIX:

None at this time. As a workaround, consider one of the following:

Check the length of the LONGCHAR variable to determine whether or not the document was saved.
Ensure that the document contains valid data before executing the SAVE method.