Consultor Eletrônico



Kbase P159373: Error 12008 with COPY-LOB and UTF-8 session
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/1/2010
Status: Unverified

SYMPTOM(s):

Error 12008 with COPY-LOB and UTF-8 session

Invalid character code found in data for codepage UTF-8 (12008)

Could not obtain LONGCHAR. (11316)

The following code will reproduce the problem in a session started with -cpinternal UTF-8. Note a blob field (customer.blobContent) has been added to the sports2000 database.

DEFINE VARIABLE longc AS LONGCHAR NO-UNDO.
DEFINE VARIABLE longc2 AS LONGCHAR NO-UNDO.
DEFINE VARIABLE c1 AS CHARACTER NO-UNDO.

find first customer.
ASSIGN longc = CHR(224,"UTF-8","1252") +
CHR(231,"UTF-8","1252") +
CHR(233,"UTF-8","1252").

COPY-LOB longc TO customer.blobContent.
COPY-LOB customer.blobContent TO longc2.
c1 = longc2.

MESSAGE c1
VIEW-AS ALERT-BOX INFO BUTTONS OK.

FACT(s) (Environment):

The client session is started with -cpinternal UTF-8.
The problem cannot be reproduced in OpenEdge 10.2B.
Windows
OpenEdge 10.2A

CAUSE:

The COPY-LOB statement is truncating the data as it is copied to the blob filed. The issue has been resolved in later versions of OpenEdge.

FIX:

Upgrade to OpenEdge 10.2B or later.

Or as a work around copy the longchar to a MEMPTR and then copy the MEMPTR to the BLOB. For example:

SET-SIZE(m1) = LENGTH(longc,"raw").
copy-lob longc to m1.
COPY-LOB m1 TO customer.blobContent.
COPY-LOB customer.blobContent TO longc2.