Kbase P115564: Compiling source code with cpstream UTF-8 results in error 134
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  26/04/2006 |
|
Status: Unverified
SYMPTOM(s):
** An open comment string (/*) was found, but no closing string. (134)
Premature EOF during &IF preprocessor handling. (2942)
Missing &ENDIF. (2964)
** Preprocessor could not understand line 318 in file <filename>'. (2124)
Compiling source code with cpstream UTF-8 results in error 134
Compiling source code does not work with 1252 -cpinternal session. The compilation works fine when -cpinternal is UTF-8.
CAUSE:
There is an extended character in a comment string in the source code, in this case an ibm850 extended character (91 hex, 145 dec). Starting Progress with -cpstream UTF-8 tells Progress that the source was written in UTF-8 and that is the code page that Progress expects characters to be written in. However, since the ibm850 character value is not a valid character in UTF-8 (80 - 255 hex), this causes the problem.
Even though the character is in a comment, the compiler checks where comment strings start and end when checking syntax. So in this case when the code is checked the compiler is expecting to read UTF-8 characters, and the hex 91 confuses the compiler.
The reason that this does not fail with -cpinternal UTF-8 -cpstream UTF-8 is because both settings are the same, and in this case Progress does not try to convert each character from cpstream to cpinternal when compiling.
FIX:
To avoid this problem avoid extended characters in comments. Ensure comments only contain ASCII characters in the decimal range of 0 - 127 (0 - 7F hex). This will avoid any invalid UTF-8 values in the source code and so the problem will not arise.