Kbase P89965: Invalid character code found in source data for codepage ISO8859-1
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/3/2004 |
|
Status: Unverified
SYMPTOM(s):
Invalid character code found in source data for codepage ISO8859-1
Failed to create/update blob from file <file-name>. (11275)
COPY-LOB failed to copy file '' to large object. (11300)
Executing code similar to:
DEFINE VARIABLE cFilename AS CHARACTER.
DEFINE TEMP-TABLE ttOSFile_Storage NO-UNDO
FIELD cFileName AS CHARACTER FORMAT "X(125)"
FIELD cImage AS CLOB
INDEX cFileName AS PRIMARY UNIQUE cFileName.
ASSIGN
cFilename = "C:\Progress\OpenEdge\odbc\odbcref.pdf".
CREATE ttOSFile_Storage.
ASSIGN
ttOSFile_Storage.cFileName = cFilename.
COPY-LOB FROM FILE cFilename TO ttOSFile_Storage.cImage.
CAUSE:
The Progress 4GL COPY-LOB function performs character conversion when the data is being assigned to the CLOB data type. In this case where the CLOB is the temp-table defined field, Progress tries to convert bytes found in the pdf file to the -cpinternal which in this case is iso8859-1. As the pdf is Adobe proprietary format that will normally contain characters that are not defined in the convmap.cp iso8859-1 code page, Progress issues the above error messages.
FIX:
One way to avoid these errors is to define the cImage field as BLOB. In this case, Progress will not do any conversion and hence no errors will be generated:
DEFINE VARIABLE cFilename AS CHARACTER.
DEFINE TEMP-TABLE ttOSFile_Storage NO-UNDO
FIELD cFileName AS CHARACTER FORMAT "X(125)"
FIELD cImage AS BLOB
INDEX cFileName AS PRIMARY UNIQUE cFileName.
ASSIGN
cFilename = "C:\Progress\OpenEdge\odbc\odbcref.pdf".
CREATE ttOSFile_Storage.
ASSIGN
ttOSFile_Storage.cFileName = cFilename.
COPY-LOB FROM FILE cFilename TO ttOSFile_Storage.cImage.